Previous | Table of Contents | Next

Page 1045

POSIX2_LOCALEDEF Indicates whether the POSIX.2 creation of locates via locale(1) is supported. The corresponding macro is POSIX2_LOCALEDEF.
_SC_2_SW_DEV Indicates whether the POSIX.2 software development utilities option is supported. The corresponding macro is POSIX2_SW_DEV.

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, syslog

closelog, openlog, syslog—Send 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:

LOG_CONS Write directly to system console if there is an error while sending to system logger
LOG_NDELAY Open the connection immediately (normally, the connection is opened when the first message is logged)
LOG_PERROR Print to stderr as well
LOG_PID Include PID with each message

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.

LOG_AUTH Security/authorization messages (DEPRECATED use LOG_AUTHPRIV instead)
LOG_AUTHPRIV Security/authorization messages (private)
LOG_CRON Clock daemon (cron and at)
LOG_DAEMON Other system daemons
LOG_KERN Kernel messages
LOG_LOCAL0 through Reserved for local use
LOG_LOCAL7 LOG_LPR
Line printer subsystem LOG_MAIL
Mail subsystem LOG_NEWS
Usenet news subsystem LOG_SYSLOG
Messages generated internally by syslogd LOG_USER (default)
Generic user-level messages LOG_UUCP
UUCP subsystem

Level

This determines the importance of the message. The levels, in order of decreasing importance, are

LOG_EMERG System is unusable
LOG_ALERT Action must be taken immediately
LOG_CRIT Critical conditions
LOG_ERR Error conditions
LOG_WARNING Warning conditions
LOG_NOTICE Normal, but significant, condition
LOG_INFO Informational message
LOG_DEBUG Debug-level message

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

system

system—Executes 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

tan

tan—Tangent 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

Previous | Table of Contents | Next

1