Page 1045
RETURN VALUE The value returned is the value of the system resource, 1 if a queried option is available, 0 if it is not, or _1 on error. The variable errno is not set. CONFORMS TO POSIX.1, proposed POSIX.2 BUGS It is difficult use ARG_MAX because it is not specified how much of the argument space for exec() is consumed by the user's environment variables. Some returned values may be huge; they are not suitable for allocating memory. POSIX.2 is not yet an approved standard; the information in this man page is subject to change. SEE ALSO bc(1), expr(1), locale(1), fpathconf(3), pathconf(3) GNU, 18 April 1993 closelog, openlog, syslogcloselog, openlog, syslogSend messages to the system logger SYNOPSIS #include <syslog.h> void openlog( char *ident,int option,int facility); void syslog( int priority, char *format, ...); void closelog( void ); DESCRIPTION closelog() closes the descriptor being used to write to the system logger. The use of closelog() is optional. openlog() opens a connection to the system logger for a program. The string pointed to by ident is added to each message, and is typically set to the program name. Values for option and facility are given in the next subsection. The use of openlog() is optional; it will automatically be called by syslog() if necessary, in which case ident will default to NULL. syslog() generates a log message, which will be distributed by syslogd(8). priority is a combination of the facility and the level, values for which are given in the next subsection. The remaining arguments are a format, as in printf(3) and any arguments required by the format, except that the two characters %m will be replaced by the error message string (strerror) corresponding to the present value of errno. PARAMETERS This section lists the parameters used to set the values of option, facility, and priority. Page 1046 OPTION The option argument to openlog() is an OR of any of these:
FACILITY The facility argument is used to specify what type of program is logging the message. This lets the configuration file specify that messages from different facilities will be handled differently.
Level This determines the importance of the message. The levels, in order of decreasing importance, are
HISTORY A syslog function call appeared in BSD 4.2. SEE ALSO logger(1), syslog.conf(5), syslogd(8) Linux, 15 February 1994 Page 1047 systemsystemExecutes a shell command SYNOPSIS #include <stdlib.h> int system (const char * string); DESCRIPTION system() executes a command specified in string by calling /bin/sh -c string, and returns after the command has been completed. During execution of the command, SIGCHLD will be blocked, and SIGINT and SIGQUIT will be ignored. RETURN VALUE The value returned is 127 if the execve() call for /bin/sh fails, _1 if there was another error, and the return code of the command otherwise. If the value of string is NULL, system() returns non-zero if the shell is available, and zero if not. system() does not affect the wait status of any other children. CONFORMS TO ANSI C, POSIX.1, proposed POSIX.2, BSD 4.3 BUGS Do not use system() from a program with suid or sgid privileges, because strange values for some environment variables might be used to subvert system integrity. Use the exec(2) family of functions instead, but not execlp(2) or execvp(2). The check for the availability of /bin/sh is not actually performed; it is always assumed to be available. It is possible for the shell command to return 127, so that code is not a sure indication that the execve() call failed; check errno to make sure. SEE ALSO sh(1), exec(2), signal(2) GNU, 13 April 1993 tantanTangent function SYNOPSIS #include <math.h> double tan(double x); DESCRIPTION The tan() function returns the tangent of x, where x is given in radians. CONFORMS TO SVID 3, POSIX, BSD 4.3, ISO 9899 |