summaryrefslogtreecommitdiff
path: root/lib/open.c
Commit message (Collapse)AuthorAgeFilesLines
* Display features in hex in debug message.Benoit Dejean2015-08-081-1/+1
|
* Fix printf format/type mistmatch.Benoit Dejean2015-07-181-1/+1
|
* Convert lots of fprintf(stderr, ...) to glibtop_debug*().Benoit Dejean2015-07-151-24/+8
|
* Run server_command instead of hardcoded LIBGTOP_SERVER.Benoit Dejean2015-06-261-3/+3
|
* The DEBUG macro enabled by --enable-debug is actually LIBGTOP_ENABLE_DEBUG.Benoit Dejean2015-06-261-8/+8
|
* Update old FSF address.Robert Roth2014-08-201-2/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=721514
* Fixed arguments type.Benoît Dejean2007-10-031-1/+1
| | | | svn path=/trunk/; revision=2671
* Removed noisy $Id$.Benoît Dejean2007-02-191-2/+0
| | | | | | | | | | 2007-02-20 Benoît Dejean <benoit@placenet.org> * *: Removed noisy $Id$. svn path=/trunk/; revision=2558
* Fixed a bunch of signedness warnings.Benoît Dejean2006-04-101-4/+4
| | | | | | | | | | 2006-04-10 Benoît Dejean <benoit@placenet.org> * lib/open.c: (glibtop_open_l): * lib/read.c: (glibtop_read_l): * lib/write.c: (glibtop_write_l): Fixed a bunch of signedness warnings.
* remove unused file.James Henstridge2005-12-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | 2005-12-12 James Henstridge <james@jamesh.id.au> * doc/auto-macros.texi.in: remove unused file. * doc/libgtop2.texi: don't include auto-macros.texi. * doc/Makefile.am: don't build auto-macros.texi, since none of its macros are used in the documentation any more. * include/glibtop/global.h: don't include <config.h> from headers. * .../*.c: make sure <config.h> is the first thing included. * acinclude.m4: m4_include() libgtop-sysdeps.m4 rather than inlining it. * acinclude.m4, libgtop-sysdeps.m4: use third argument to AC_DEFINE() to set the comment. * configure.in: modernise a bit. * acconfig.h: remove file, since it is deprecated * autogen.sh: require automake 1.9 instead of 1.4.
* Removed some dead files. Don't install private headers.Benoît Dejean2005-02-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * backends/server/server.h: * configure.in: * glibtop.h: * include/glibtop/Makefile.am: * include/glibtop/gnuserv.h: * include/glibtop/open.h: * include/glibtop/read.h: * include/glibtop/read_data.h: * include/glibtop/types.h: * include/glibtop/write.h: * lib/close.c: * lib/init.c: * lib/lib.pl: * lib/open.c: * lib/parameter.c: * lib/read.c: * lib/read_data.c: * lib/write.c: * src/daemon/daemon.h: * src/daemon/io.c: * src/daemon/main.c: (handle_parent_connection): * src/daemon/slave.c: (handle_slave_connection), (handle_slave_command): * sysdeps/common/gnuslib.c: * sysdeps/solaris/glibtop_private.h: Removed some dead files. Don't install private headers.
* whitespace clean up.Benoît Dejean2004-06-091-13/+13
| | | | * *.{c,h} : whitespace clean up.
* - fixed compilationBastien Nocera2003-10-201-1/+0
|
* libgtop-GNOME-2-0-branch moved to HEAD.Carlos Perelló Marín2003-10-191-10/+148
| | | | | | 2003-10-19 Carlos Perelló Marín <carlos@gnome.org> * libgtop-GNOME-2-0-branch moved to HEAD.
* New type. (glibtop): Added `glibtop_server_info *info', moved `ncpu',Martin Baulig2000-11-201-1/+1
| | | | | | | | | 2000-11-20 Martin Baulig <baulig@suse.de> * glibtop.h (glibtop_server_info): New type. (glibtop): Added `glibtop_server_info *info', moved `ncpu', `features', `sysdeps', `required' and `wanted' info glibtop_server_info.
* Removed `method', `server_command', `server_host', `server_user' andMartin Baulig2000-02-061-0/+3
| | | | | | | | | | | | | | | 2000-02-06 Martin Baulig <martin@home-of-linux.org> * glibtop.h (glibtop): Removed `method', `server_command', `server_host', `server_user' and `server_rsh'. Added `glibtop_parameter _param' field and moved `error_method' there. * include/glibtop/parameter.h (glibtop_parameter): New structure. (GLIBTOP_PARAM_METHOD, GLIBTOP_PARAM_COMMAND): Removed. (GLIBTOP_PARAM_HOST, GLIBTOP_PARAM_PORT): Removed. (GLIBTOP_PARAM_REMOTE_USER, GLIBTOP_PARAM_PATH_RSH): Removed. (GLIBTOP_PARAM_NCPU, GLIBTOP_PARAM_OS_VERSION_CODE): Added.
* Call glibtop_init_backend () and _glibtop_open_sysdeps () here.Martin Baulig2000-01-131-4/+8
| | | | | | | 2000-01-13 Martin Baulig <martin@home-of-linux.org> * lib/open.c (glibtop_open_l): Call glibtop_init_backend () and _glibtop_open_sysdeps () here.
* *** empty log message ***Martin Baulig2000-01-021-2/+0
|
* New directory. New directory. New directory.Martin Baulig2000-01-011-152/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-01-01 Martin Baulig <martin@home-of-linux.org> * backends/: New directory. * backends/server/: New directory. * backends/sysdeps/: New directory. * include/glibtop/backend.h: New file. * include/glibtop/call-vector.h.in: New file. Template file for `call-vector.h'. * include/glibtop/call-vector.pl: New file. Creates 'call-vector.h' from `call-vector.h.in'. * include/glibtop/errors.h (GLIBTOP_ERROR_NO_SUCH_BACKEND): New error constant. (GLIBTOP_ERROR_NOT_IMPLEMENTED): New error constant. * include/glibtop/limits.h (GLIBTOP_BACKEND_NAME_LEN): New constant. * glibtop-server-private.h (glibtop_server_private): Added `GSList *backend_list' and removed `input', `output', `socket' and `pid'. * lib/command.c: Removed. Moved to `backends/server/'. * lib/read.c: Removed. Moved to `backends/server/'. * lib/read_data.c: Removed. Moved to `backends/server/'. * lib/write.c: Removed. Moved to `backends/server/'.
* The indentation in LibGTop was done with the following command:Martin Baulig1999-12-261-98/+100
| | | | | | | | find . -name \*.[ch] | xargs -i emacs -batch {} \ -l /gnome/compile/libgtop/misc/format.el -f save-buffer December 26, 1999 Martin
* New file. This is a private header file which defines `structMartin Baulig1999-12-191-11/+17
| | | | | | | | | | 1999-12-19 Martin Baulig <martin@home-of-linux.org> * glibtop-server-private.h: New file. This is a private header file which defines `struct _glibtop_server_private'. * glibtop.h (glibtop): Added `glibtop_server_private *_priv' field and moved some private fields there.
* Use `retval' for the default retval.Martin Baulig1999-10-241-1/+2
| | | | | | | | | | 1999-10-24 Martin Baulig <martin@home-of-linux.org> * features.def: Use `retval' for the default retval. * include/glibtop/command.h (glibtop_command_h): Added `int *retval_ptr' parameter to return the retval from the sysdeps functions.
* Set the copyright of LibGTop to the GNU General Public License.Martin Baulig1999-02-231-7/+7
| | | | | | | | | 1999-02-22 Martin Baulig <martin@home-of-linux.org> Set the copyright of LibGTop to the GNU General Public License. * copyright.txt: Set the year to 1998-99 and pretty-format it a little bit. Same in all C source and header files.
* Include a copy of the GNU Library General Public License here.Martin Baulig1999-02-221-13/+15
| | | | | | | | | | 1999-02-22 Martin Baulig <martin@home-of-linux.org> * COPYING.LIB: Include a copy of the GNU Library General Public License here. * copyright.txt: Set the year to 1998-99 and pretty-format it a little bit. Same in all C source and header files.
* Reverted my last brain-dead commit.Martin Baulig1999-02-191-20/+9
| | | | | | | | Logical error: we need to check whether the server runs on the system it was compiled on and not whether the client uses a server that was compiled on the clients system.
* For suid/sgid servers the operating system version must match the one theMartin Baulig1999-02-191-9/+20
| | | | | | | | 1999-02-19 Martin Baulig <martin@home-of-linux.org> * lib/open.c, src/daemon/version.c: For suid/sgid servers the operating system version must match the one the server was compiled on.
* Small fix for 64bit systems.Martin Baulig1999-02-191-1/+1
|
* We need to set argv[0] in call to execl () to avoid a core dump in _initMartin Baulig1998-11-171-1/+1
| | | | | | | 1998-11-18 Martin Baulig <martin@home-of-linux.org> * lib/open.c (glibtop_open_l): We need to set argv[0] in call to execl () to avoid a core dump in _init () on FreeBSD 3.0.
* Enclosed some debugging statements in `#ifdef DEBUG'.Martin Baulig1998-10-031-1/+15
|
* Now using correct default server.Martin Baulig1998-08-091-25/+0
|
* Minor server/daemon cleanups; reading sysdeps from server now working.Martin Baulig1998-08-081-0/+2
|
* Call `glibtop_init_s' instead of `glibtop_open_s'.Martin Baulig1998-08-081-1/+1
|
* Removed. New files. Added `libgtop_server'; this has been moved here fromMartin Baulig1998-08-071-17/+29
| | | | | | | | | | | | | | | | | | | | | | | | | 1998-08-07 Martin Baulig <martin@home-of-linux.org> * src/server: Removed. * src/daemon/{server, version}.c: New files. * src/daemon/Makefile.am: Added `libgtop_server'; this has been moved here from `src/server' since it shares some source code files with the `libgtop_daemon'. * LIBGTOP-VERSION: Added `LIBGTOP_SERVER_VERSION'. * src/daemon/gnuserv.c, lib/open.c: Improved version check between client and server. * include/glibtop/output.h: Removed. * sysdeps/stub_suid: New directory. This is mainly used as example for people porting libgtop to other systems. * sysdeps/common/sysdeps_suid.c: New file. Defines `glibtop_init_hook_p'. * sysdeps/osf1/*.c (glibtop_init_<no-suid-feature>_s): New functions. (glibtop_init_<suid-feature>_p): New functions.
* New fields `error_method', `sysdeps' and `required'. I added an improvedMartin Baulig1998-08-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1998-08-07 Martin Baulig <martin@home-of-linux.org> * glibtop.h (_glibtop): New fields `error_method', `sysdeps' and `required'. I added an improved error handling: the client can tell the libraries which fields are absolutely required for each features and if it fails to set one of them, this will create an error which is handled depending upon the `error_method'. * include/glibtop/open.h: Define some constants for `error_method'. * lib/sysdeps.c (glibtop_get_sysdeps_r): No longer actually call any sysdeps function, it now simply copies `server->sysdeps'. (_glibtop_init_hook_s): Added. List of functions to be called during `glibtop_init_s' set to `glibtop_init_<no-suid-feature>_s'. * include/glibtop/sysdeps.h (<glibtop/union.h>): Removed. (glibtop_init_func_t): New typedef. (_glibtop_init_hook_s): Added. * sysdeps/linux/*.c (glibtop_init_<feature>_s): New functions. (glibtop_get_proc_*): Zero is now a valid pid. * sysdeps/kernel/*.c (glibtop_init_<feature>_s): New functions. (glibtop_get_proc_*): Zero is now a valid pid. 1998-08-06 Martin Baulig <martin@home-of-linux.org>
* Using `GLIBTOP_GUILE' instead of `HAVE_GUILE' so one should be able to useMartin Baulig1998-08-061-1/+5
| | | | | | | | | | | | | | | 1998-08-06 Martin Baulig <martin@home-of-linux.org> * include/glibtop/*.h: Using `GLIBTOP_GUILE' instead of `HAVE_GUILE' so one should be able to use libgtop without guile in an application even if guile is installed. * sysdeps/common/mountlist.c: Fixed some `xstrdup' problems. * lib/open.c: Now correctly reading server features for `GLIBTOP_METHOD_PIPE'. * sysdeps/freebsd: New directory.
* Using `u_int64_t' instead of `unsigned long' and `long' to avoid problemsMartin Baulig1998-07-301-0/+7
| | | | | | | | 1998-07-30 Martin Baulig <martin@home-of-linux.org> * include/glibtop/*.h: Using `u_int64_t' instead of `unsigned long' and `long' to avoid problems when client is on a 32bit system and the server on a 64bit system.
* New file.Martin Baulig1998-07-291-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1998-07-29 Martin Baulig <martin@home-of-linux.org> * guile/ChangeLog: New file. * features.def: New format - now includes type of return value and parameters. * lib/lib.awk: Changed to use new `features.def'. * sysdeps/guile/guile.awk: Dito; * sysdeps/guile/names/guile-names.awk: Dito. * libgtopConf.sh.in: Added `LIBGTOP_NAMES_LIBS', `LIBGTOP_NAMES_INCS', `LIBGTOP_GUILE_NAMES_LIBS', `LIBGTOP_GUILE_NAMES_INCS', `LIBGTOP_MAJOR_VERSION', `LIBGTOP_MINOR_VERSION' `LIBGTOP_VERSION', `libgtop_sysdeps_dir'. * acinclude.m4 (AC_LC_SYSDEPS): Removed since this has been replaced with `GNOME_LIBGTOP_SYSDEPS' long ago. * LIBGTOP-VERSION: New file. * */Makefile.am (INCLUDES): Removed; now defined in `configure.in'. * sysdeps/names/mountlist.c: New file. * lib/{init, open}.c (GTOP_SERVER): Renamed to `LIBGTOP_SERVER'. * configure.in (INCLUDES): Added definition. (libgtop_want_names): Always true; `libgtop_names.la' is now always created since some other programs rely upon it - but have to use `LIBGTOP_NAMES_LIBS' and `LIBGTOP_NAMES_INCS' to use it in your application. (libgtop_want_guile_names): Always true; but you have to use `LIBGTOP_GUILE_NAMES_LIBS' and `LIBGTOP_GUILE_NAMES_INCS' to use it in your application. (LIBGTOP_LIBS): Removed `-lgtop_names' and `-lgtop_guile_names'. (LIBGTOP_NAMES_LIBS): New variable. Use it to link your application with the names interface. (LIBGTOP_NAMES_INCS): New variable. Also #defines `GLIBTOP_NAMES' which is now required if your application wants to use the names interface. (LIBGTOP_GUILE_NAMES_LIBS): New variable. Use it to link your application with the guile names interface. (LIBGTOP_GUILE_NAMES_INCS): New variable. Also #defines `GLIBTOP_NAMES' and `GLIBTOP_GUILE_NAMES' which are now required if your application wants to use the guile names interface.
* New file.Martin Baulig1998-07-221-0/+11
| | | | | | | | | | | 1998-07-22 Martin Baulig <martin@home-of-linux.org> * include/glibtop/mountlist.h: New file. * features.def: Added new feature `mountlist'. * sysdeps/common/mountlist.c (glibtop_get_mountlist_s): New function. (read_filesystem_list): Declared as `static'.
* Summary of this long ChangeLog:Martin Baulig1998-07-221-14/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Splitted `libgtop_sysdeps.la' into `libgtop_sysdeps.la' and `libgtop_sysdeps_suid.la'. Everything that needs to be suid/sgid is in `libgtop_sysdeps_suid.la' and the rest in `libgtop_sysdeps.la'. The functions from `libgtop_sysdeps_suid.la' have the `_p' prefix and the ones from `libgtop_sysdeps.la' the `_s' prefix. The suid library uses `glibtop_open_p' and `glibtop_close_p', the normal one `glibtop_init_s' (found in lib/init.c), `glibtop_open_s' and `glibtop_close_s'. * Added `libgtop_suid_common.la' containing stuff from sysdeps/common that is required from the suid server (currently everything from error.c and xmalloc.c). This means, we can add some more stuff to `libgtop_common.la' without the risk that it may be dangerous in the suid server. * The ``library order'' is much clearer now: -> `libgtop.la' (from lib/) contains user-level stuff; all functions except `glibtop_init_r' have the `_l' suffix. -> `libgtop_common.la' (from sysdeps/common/) contains stuff that is common among the sysdeps directories. use anything from `libgtop_sysdeps.la' and `libgtop_sysdeps_suid.la'. -> `libgtop_sysdeps.la' (from sysdeps/<sysdeps_dir>/) contains everything from the sysdeps directory that doesn't need to be suid/sgid. -> `libgtop_suid_common.la' (from sysdeps/common/) is used from the suid server instead of `libgtop_common.la'. -> `libgtop_sysdeps_suid.la' (from sysdeps/<sysdeps_dir>/) contains everything from the sysdeps directory that needs to be in the suid server. * To summarize: the server is linked only with functions that need to be suid and everything else is linked only with functions that do not need to be suid. Martin 1998-07-22 Martin Baulig <martin@home-of-linux.org> * lib/init.c (glibtop_init_s): Added this init function of the sysdeps directory `libgtop_sysdeps.la'. * lib/open.c (glibtop_open_l): Unconditionally calling `glibtop_init_s' after server initialization. * lib/lib.awk: Removed references to functions from `libgtop_sysdeps_suid.la' to avoid undefined symbols. * sysdeps/stub/open.c (glibtop_open_s): Renamed this function from `glibtop_open_r'. * sysdeps/stub/close.c (glibtop_close_s): Renamed this function from `glibtop_close_l'. * sysdeps/kernel/open.c (glibtop_open_s): Renamed this function from `glibtop_open_r'. * sysdeps/kernel/close.c (glibtop_close_s): Renamed this function from `glibtop_close_l'. * sysdeps/linux/open.c (glibtop_open_s): Renamed this function from `glibtop_open_r'. * sysdeps/linux/close.c (glibtop_close_s): Renamed this function from `glibtop_close_l'. * sysdeps/osf1/Makefile.am (lib_LTLIBRARIES): Added `libgtop_sysdeps_suid.la' for the suid server. * sysdeps/osf1/open_suid.c (glibtop_open_p): New file. Contains all stuff that was formerly in `open.c'. * sysdeps/osf1/open.c: Moved everything from here into the new file `open_suid.c'. * sysdeps/osf1/open.c (glibtop_open_s): New function. * sysdeps/osf1/close_suid.c (glibtop_close_p): New file. * sysdeps/osf1/close.c (glibtop_close_s): New function. * sysdeps/osf1/*.c: Using the new init, open and close functions. * sysdeps/sun4/Makefile.am (lib_LTLIBRARIES): Added `libgtop_sysdeps_suid.la' for the suid server. * sysdeps/sun4/nosuid.c (glibtop_open_s, glibtop_close_s): New file * sysdeps/sun4/*.c: All functions now have the `_p' suffix. * sysdeps/common/Makefile.am (lib_LTLIBRARIES): Added `libgtop_suid_common.la' which only contains stuff that is needed in the suid parts. * sysdeps/common/xmalloc.c: Using `glibtop_error_io_r' instead of `glibtop_error_r'. * sysdeps/{kernel, linux, osf1, sun4, stub}/init.c: Removed. `glibtop_init_s' has been moved into `lib/init.c' since it's the same in all the sysdeps directories. * src/server/main.c: It is now an error to request a feature that does not need the suid server. * src/proxy: Removed.
* Added `GLIBTOP_METHOD_PIPE' again.Martin Baulig1998-07-181-0/+48
| | | | | | | | 1998-07-18 Martin Baulig <martin@home-of-linux.org> * lib/{init, open}.c: Added `GLIBTOP_METHOD_PIPE' again. * src/server/main.c: Removed gettext stuff.
* Doing correct server initialization using `glibtop_set_parameter_l' andMartin Baulig1998-07-141-0/+6
| | | | | | | | | | | | | | | | 1998-07-14 Martin Baulig <martin@home-of-linux.org> * src/daemon/gnuserv.c: Doing correct server initialization using `glibtop_set_parameter_l' and `glibtop_init_r'. * src/daemon/main.c: Removed call to `glibtop_init_r'. * lib/open.c (glibtop_open_l): We now call the open function of the sysdeps directory (glibtop_open_r) for server method `GLIBTOP_METHOD_DIRECT'. * sysdeps/{linux, sun4, stub}/open.c: No longer `memset' server to zero.
* Basically did some work on the new daemon. Things are still unstable.Martin Baulig1998-07-131-5/+24
| | | | | | | | | | | | | | | | | | | | | | | | | 1998-07-13 Martin Baulig <martin@home-of-linux.org> * glibtop.h: Fixed invocation of `glibtop_close_r'. * sysdeps/linux/procstate.c: Added missing `fclose'. * include/glibtop/gnuserv.h (UNIX_DOMAIN_SOCKETS): Defining. * include/glibtop/open.h (GLIBTOP_METHOD_UNIX): Added. * lib/init.c: Added new method `GLIBTOP_METHOD_UNIX'. * lib/open.c: Added support for Unix Domain Sockets. * lib/close.c: Now closing inet and unix connections. * lib/parameter.c (glibtop_set_parameter_l): You can now set the `method' and `features' fields. * src/daemon/server_config.h: New file. * src/daemon/{gnuserv.c, main.c}: More work on the server.
* No longer use `glibtop_machine.h' for Linux.Martin baulig1998-07-031-82/+21
| | | | | | | | | | | | | | | | | | | | | | | 1998-07-03 Martin baulig <martin@home-of-linux.org> * macros/gnome-libgtop-sysdeps.m4: No longer use `glibtop_machine.h' for Linux. * sysdeps/linux/glibtop_machine.h: Removed. * sysdeps/guile/guile.awk: Using `scm_append' instead of `gh_append'. * sysdeps/guile/names/guile-names.awk: dito. * sysdeps/linux/*.c: Using code from stable branch again. * include/glibtop/parameter.h: New file. * lib/parameter.c: New file. * lib/{open, init}.c: Done some more work on server initialization
* Some more daemon stuff.Martin Baulig1998-06-181-111/+64
|
* Did some more work on the daemon.Martin Baulig1998-06-141-2/+22
|
* Using single underscore instead of two underscores for function prefixesMartin Baulig1998-06-071-8/+8
| | | | | | | | 1998-06-07 Martin Baulig <martin@home-of-linux.org> * *.[ch]: Using single underscore instead of two underscores for function prefixes (regexp: ``s,__([rspl])\b,_$1,g'') to avoid ambiguity with mangled C++ names.
* renamed to `glibtop_open__l'.Martin Baulig1998-06-021-2/+2
| | | | * lib/open.c (glibtop_open): renamed to `glibtop_open__l'.
* tells `glibtop_open' to use the default server and not to check theMartin Baulig1998-06-021-56/+78
| | | | | | | | | | | | * include/glibtop/open.h (GLIBTOP_OPEN_NO_OVERRIDE): tells `glibtop_open' to use the default server and not to check the environment variables. * include/glibtop/sysdeps.h (_glibtop_sysdeps): renamed 'dummy' member to 'features'. * include/glibtop/command.h (GLIBTOP_CMND_SYSDEPS): added definition here.
* removed #if's - we now decide at runtime whether to use the server or toMartin Baulig1998-06-011-2/+76
| | | | | | * lib/*.c: removed #if's - we now decide at runtime whether to use the server or to call the appropriate function for the sysdeps directory.
* renamed all functions that implementing features to '__l'; we only emitMartin Baulig1998-05-281-1/+1
| | | | | | * lib/*.c: renamed all functions that implementing features to '__l'; we only emit code for those functions if the corresponding 'GLIBTOP_SUID_<feature>' has a positive value.