©2004 by Marc J. Rochkind. All rights reserved. Portions marked "Open Source" may be copied under license.

 

Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

SUS_Summary File Reference


Detailed Description

Summary of Standard UNIX Functions, Structures, and Unions.

This page summarizes the 307 functions, 38 structures, and 2 unions included in Advanced UNIX Programming, 2nd Edition.

Note that signal and sigset are listed as variables due to a parsing problem with Doxygen, which was used to generate this page.

Definition in file SUS_Summary.

Go to the source code of this file.

Compounds

struct  addrinfo
struct  aiocb
struct  dirent
struct  flock
struct  group
struct  hostent
struct  if_nameindex
struct  iovec
struct  ipc_perm
struct  itimerspec
struct  itimerval
struct  mq_attr
struct  msg
struct  msghdr
struct  msqid_ds
struct  netent
struct  passwd
struct  pollfd
struct  protoent
struct  rlimit
struct  rusage
struct  sembuf
struct  semid_ds
union  semun
struct  servent
struct  sigaction
struct  sigevent
struct  siginfo_t
union  sigval
struct  SimpleSem
struct  sockaddr_in
struct  sockaddr_in6
struct  sockaddr_un
struct  stat
struct  statvfs
struct  termios
struct  timespec
struct  timeval
struct  tm
struct  tms
struct  utimbuf

Functions

void FD_CLR (int fd, fd_set *fdset)
int FD_ISSET (int fd, fd_set *fdset)
void FD_SET (int fd, fd_set *fdset)
void FD_ZERO (fd_set *fdset)
void _Exit (int status)
void _exit (int status)
void _longjmp (jmp_buf loc_info, int val)
int _setjmp (jmp_buf loc_info)
void abort (void)
int accept (int socket_fd, struct sockaddr *sa, socklen_t *sa_len)
int access (const char *path, int what)
int aio_cancel (int fd, struct aiocb *aiocbp)
int aio_error (const struct aiocb *aiocbp)
int aio_fsync (int op, struct aiocb *aiocbp)
int aio_read (struct aiocb *aiocbp)
ssize_t aio_return (struct aiocb *aiocbp)
int aio_suspend (const struct aiocb *const list[], int cbcnt, const struct timespec *timeout)
int aio_write (struct aiocb *aiocbp)
unsigned alarm (unsigned secs)
char * asctime (const struct tm *tmbuf)
int atexit (void(*fcn)(void))
int bind (int socket_fd, const struct sockaddr *sa, socklen_t sa_len)
speed_t cfgetispeed (const struct termios *tp)
speed_t cfgetospeed (const struct termios *tp)
int cfsetispeed (struct termios *tp, speed_t speed)
int cfsetospeed (struct termios *tp, speed_t speed)
int chdir (const char *path)
int chmod (const char *path, mode_t mode)
int chown (const char *path, uid_t uid, gid_t gid)
int chroot (const char *path)
clock_t clock (void)
int clock_getcpuclockid (pid_t pid, clockid_t *clock_id)
int clock_getres (clockid_t clock_id, struct timespec *res)
int clock_gettime (clockid_t clock_id, struct timespec *tp)
int clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *nsecs, struct timespec *remain)
int clock_settime (clockid_t clock_id, const struct timespec *tp)
int close (int fd)
int closedir (DIR *dirp)
size_t confstr (int name, char *buf, size_t len)
int connect (int socket_fd, const struct sockaddr *sa, socklen_t sa_len)
int creat (const char *path, mode_t perms)
char * ctermid (char *buf)
char * ctime (const time_t *t)
double difftime (time_t time1, time_t time0)
int dup (int fd)
int dup2 (int fd, int fd2)
void endhostent (void)
void endnetent (void)
void endprotoent (void)
void endservent (void)
int execl (const char *path, const char *arg0, const char *arg1,..., (char *)NULL)
int execle (const char *path, const char *arg0, const char *arg1,..., (char *)NULL, char *const envv[])
int execlp (const char *file, const char *arg0, const char *arg1,..., (char *)NULL)
int execv (const char *path, char *const argv[])
int execve (const char *path, char *const argv[], char *const envv[])
int execvp (const char *file, char *const argv[])
void exit (int status)
int fchdir (int fd)
int fchmod (int fd, mode_t mode)
int fchown (int fd, uid_t uid, gid_t gid)
int fcntl (int fd, int op,...)
int fdatasync (int fd)
pid_t fork (void)
long fpathconf (int fd, int name)
void freeaddrinfo (struct addrinfo *infop)
int fstat (int fd, struct stat *buf)
int fstatvfs (int fd, struct statvfs *buf)
int fsync (int fd)
key_t ftok (const char *path, int id)
int ftruncate (int fd, off_t length)
const char * gai_strerror (int code)
int getaddrinfo (const char *nodename, const char *servname, const struct addrinfo *hint, struct addrinfo **infop)
char * getcwd (char *buf, size_t bufsize)
tm * getdate (const char *s)
gid_t getegid (void)
char * getenv (const char *var)
uid_t geteuid (void)
gid_t getgid (void)
group * getgrgid (gid_t gid)
hostent * gethostbyaddr (const void *addr, socklen_t len, int family)
hostent * gethostbyname (const char *nodename,)
hostent * gethostent (void)
long gethostid (void)
int gethostname (char *name, size_t namelen)
int getitimer (int which, struct itimerval *val)
char * getlogin (void)
int getnameinfo (const struct sockaddr *sa, socklen_t sa_len, char *nodename, socklen_t nodelen, char *servname, socklen_t servlen, unsigned flags)
netent * getnetbyaddr (uint32_t net, int type)
netent * getnetbyname (const char *name)
netent * getnetent (void)
int getpeername (int socket_fd, struct sockaddr *sa, socklen_t *sa_len)
pid_t getpgid (pid_t pid)
pid_t getpid (void)
pid_t getppid (void)
protoent * getprotobyname (const char *name)
protoent * getprotobynumber (int proto)
protoent * getprotoent (void)
passwd * getpwuid (uid_t uid)
int getrlimit (int resource, struct rlimit *rlp)
int getrusage (int who, struct rusage *r_usage)
servent * getservbyname (const char *name, const char *proto)
servent * getservbyport (int port, const char *proto)
servent * getservent (void)
pid_t getsid (pid_t pid)
int getsockname (int socket_fd, struct sockaddr *sa, socklen_t *sa_len)
int getsockopt (int socket, int level, int option, const void *value, socklen_t *value_len)
int gettimeofday (struct timeval *tvalbuf, void *dummy)
uid_t getuid (void)
tm * gmtime (const time_t *t)
int grantpt (int fd)
uint32_t htonl (uint32_t hostnum)
uint16_t htons (uint16_t hostnum)
void if_freenameindex (struct if_nameindex *ptr)
char * if_indextoname (unsigned ifindex, char *ifname)
if_nameindex * if_nameindex (void)
unsigned if_nametoindex (const char *ifname)
in_addr_t inet_addr (const char *cp)
char * inet_ntoa (struct in_addr in)
const char * inet_ntop (int domain, const void *src, char *dst, socklen_t dst_len)
int inet_pton (int domain, const char *src, void *dst)
int ioctl (int fd, int req,...)
int isatty (int fd)
int kill (pid_t pid, int signum)
int killpg (pid_t pgrp, int signum)
int lchown (const char *path, uid_t uid, gid_t gid)
int link (const char *oldpath, const char *newpath)
int lio_listio (int mode, struct aiocb *const list[], int cbcnt, struct sigevent *sig)
int listen (int socket_fd, int backlog)
tm * localtime (const time_t *t)
int lockf (int fd, int op, off_t len)
void longjmp (jmp_buf loc_info, int val)
off_t lseek (int fd, off_t pos, int whence)
int lstat (const char *path, struct stat *buf)
int mkdir (const char *path, mode_t perms)
int mkfifo (const char *path, mode_t perms)
int mknod (const char *path, mode_t perms, dev_t dev)
int mkstemp (char *template)
time_t mktime (struct tm *tmbuf)
void * mmap (void *addr, size_t len, int prot, int flags, int fd, off_t off)
int mount (const char *source, const char *target, const char *type, unsigned long flags, const void *data)
int mq_close (mqd_t mqd)
int mq_getattr (mqd_t mqd, struct mq_attr *attr)
int mq_notify (mqd_t mqd, const struct sigevent *ep)
mqd_t mq_open (const char *name, int flags)
ssize_t mq_receive (mqd_t mqd, char *msg, size_t msgsize, unsigned *priorityp)
int mq_send (mqd_t mqd, const char *msg, size_t msgsize, unsigned priority)
int mq_setattr (mqd_t mqd, const struct mq_attr *attr, struct mq_attr *oldattr)
ssize_t mq_timedreceive (mqd_t mqd, char *msg, size_t msgsize, unsigned *priorityp const struct timespec *tmout)
int mq_timedsend (mqd_t mqd, const char *msg, size_t msgsize, unsigned priority const struct timespec *tmout)
int mq_unlink (const char *name)
int msgctl (int msqid, int cmd, struct msqid_ds *data)
int msgget (key_t key, int flags)
ssize_t msgrcv (int msqid, const void *msgp, size_t mtextsize, long msgtype, int flags)
int msgsnd (int msqid, const void *msgp, size_t msgsize, int flags)
int munmap (void *addr, size_t len)
int nanosleep (const struct timespec *nsecs, struct timespec *remain)
int nice (int incr)
uint32_t ntohl (uint32_t netnum)
uint16_t ntohs (uint16_t netnum)
int open (const char *path, int flags, mode_t perms)
DIR * opendir (const char *path)
long pathconf (const char *path, int name)
int pause (void)
int pipe (int pfd[2])
int poll (struct pollfd fdinfo[], nfds_t nfds, int timeout)
int posix_openpt (int oflag)
ssize_t pread (int fd, void *buf, size_t nbytes off_t offset)
int pselect (int nfds, fd_set *readset, fd_set *writeset, fd_set *errorset, const struct timespec *timeout, const sigset_t *sigmask)
int pthread_cancel (pthread_t thread_id)
void pthread_cleanup_pop (int execute)
void pthread_cleanup_push (void(*handler)(void *), void *arg)
int pthread_cond_signal (pthread_cond_t *cond)
int pthread_cond_wait (pthread_cond_t *cond, pthread_mutex_t *mutex)
int pthread_create (pthread_t *thread_id, const pthread_attr_t *attr, void *(*start_fcn)(void *), void *arg)
int pthread_join (pthread_t thread_id, void **status_ptr)
int pthread_kill (pthread_t thread_id, int signum)
int pthread_mutex_lock (pthread_mutex_t *mutex)
int pthread_mutex_unlock (pthread_mutex_t *mutex)
int pthread_sigmask (int how, const sigset_t *set, sigset_t *oset)
void pthread_testcancel (void)
char * ptsname (int fd)
int putenv (char *string)
ssize_t pwrite (int fd, const void *buf, size_t nbytes off_t offset)
int raise (int signum)
ssize_t read (int fd, void *buf, size_t nbytes)
dirent * readdir (DIR *dirp)
int readdir_r (DIR *restrict dirp, struct dirent *entry, struct dirent **result)
ssize_t readlink (const char *path, char *buf, size_t bufsize)
ssize_t readv (int fd, const struct iovec *iov, int iovcnt)
ssize_t recv (int socket_fd, void *buffer, size_t length, int flags)
ssize_t recvfrom (int socket_fd, void *buffer, size_t length, int flags, struct sockaddr *sa, socklen_t *sa_len)
ssize_t recvmsg (int socket_fd, struct msghdr *message, int flags)
int rename (const char *oldpath, const char *newpath)
void rewinddir (DIR *dirp)
int rmdir (const char *path)
void seekdir (DIR *dirp, long loc)
int select (int nfds, fd_set *readset, fd_set *writeset, fd_set *errorset, struct timeval *timeout)
int sem_close (sem_t *sem)
int sem_destroy (sem_t *sem)
int sem_getvalue (sem_t *restrict sem, int *valuep)
int sem_init (sem_t *sem, int pshared, unsigned value)
sem_tsem_open (const char *name, int flags)
int sem_post (sem_t *sem)
int sem_timedwait (sem_t *restrict sem, const struct timespec *time)
int sem_trywait (sem_t *sem)
int sem_unlink (const char *name)
int sem_wait (sem_t *sem)
int semctl (int semid, int semnum, int cmd, union semun arg)
int semget (key_t key, int nsems, int flags)
int semop (int semid, struct sembuf *sops, size_t nsops)
ssize_t send (int socket_fd, const void *data, size_t length, int flags)
ssize_t sendmsg (int socket_fd, const struct msghdr *message, int flags)
ssize_t sendto (int socket_fd, const void *message, size_t length, int flags, const struct sockaddr *sa, socklen_t sa_len)
int setegid (gid_t gid)
int setenv (const char *var, const char *val, int overwrite)
int seteuid (uid_t uid)
int setgid (gid_t gid)
void sethostent (int stayopen)
int setitimer (int which, const struct itimerval *val, struct itimerval *oval)
int setjmp (jmp_buf loc_info)
void setnetent (int stayopen)
int setpgid (pid_t pid, pid_t pgid)
void setprotoent (int stayopen)
int setrlimit (int resource, const struct rlimit *rlp)
void setservent (int stayopen)
pid_t setsid (void)
int setsockopt (int socket_fd, int level, int option, const void *value, socklen_t value_len)
int setuid (uid_t uid)
int shm_open (const char *name, int flags, mode_t perms)
int shm_unlink (const char *name)
void * shmat (int shmid, const void *shmaddr, int flags)
int shmctl (int shmid, int cmd, struct shmid_ds *data)
int shmdt (const void *shmaddr)
int shmget (key_t key, size_t size, int flags)
int shutdown (int socket_fd, int how)
int sigaction (int signum, const struct sigaction *act, struct sigaction *oact)
int sigaddset (sigset_t *set, int signum)
int sigaltstack (const stack_t *stack, stack_t *ostack)
int sigdelset (sigset_t *set, int signum)
int sigemptyset (sigset_t *set)
int sigfillset (sigset_t *set)
int sighold (int signum,)
int sigignore (int signum,)
int siginterrupt (int signum, int flag)
int sigismember (const sigset_t *set, int signum)
void siglongjmp (sigjmp_buf loc_info, int val)
int sigpause (int signum,)
int sigpending (sigset_t *set)
int sigprocmask (int how, const sigset_t *set, sigset_t *oset)
int sigqueue (pid_t pid, int signum, const union sigval value)
int sigrelse (int signum,)
int sigsetjmp (sigjmp_buf loc_info, int savemask)
int sigsuspend (const sigset_t *sigmask)
int sigtimedwait (const sigset_t *set, siginfo_t *info, const struct timespec *ts)
int sigwait (const sigset_t *set, int *signum)
int sigwaitinfo (const sigset_t *set, siginfo_t *info)
unsigned sleep (unsigned secs)
int sockatmark (int socket_fd,)
int socket (int domain, int type, int protocol)
int socketpair (int domain, int type, int protocol int socket_vector[2])
int stat (const char *path, struct stat *buf)
int statvfs (const char *path struct statvfs *buf)
size_t strftime (char *buf, size_t bufsize, const char *format, const struct tm *tmbuf)
char * strptime (const char *s, const char *format, struct tm *tmbuf)
int symlink (const char *oldpath, const char *newpath)
void sync (void)
long sysconf (int name)
int system (const char *command)
int tcdrain (int fd)
int tcflow (int fd, int action)
int tcflush (int fd, int queue)
int tcgetattr (int fd, struct termios *tp)
pid_t tcgetpgrp (int fd)
pid_t tcgetsid (int fd)
int tcsendbreak (int fd, int duration)
int tcsetattr (int fd, int actions, const struct termios *tp)
int tcsetpgrp (int fd, pid_t pgid)
long telldir (DIR *dirp)
time_t time (time_t *t)
int timer_create (clockid_t clockid, struct sigevent *sig, timer_t *timer_id)
int timer_delete (timer_t timer_id)
int timer_getoverrun (timer_t timer_id)
int timer_gettime (timer_t timer_id, struct itimerspec *val)
int timer_settime (timer_t timer_id, int flags, const struct itimerspec *val, struct itimerspec *oval)
clock_t times (struct tms *buffer)
int truncate (const char *path, off_t length)
char * ttyname (int fd)
int ttyname_r (int fd, char *buf, size_t bufsize)
void tzset (void)
long ulimit (int cmd,...)
mode_t umask (mode_t cmask)
int umount (const char *target)
int uname (struct utsname *name)
int unlink (const char *path)
int unlockpt (int fd)
int unsetenv (const char *var)
int usleep (useconds_t usecs)
int utime (const char *path, const struct utimbuf *timbuf)
pid_t vfork (void)
pid_t wait (int *statusp,)
int waitid (idtype_t idtype, id_t id, siginfo_t *infop, int options)
pid_t waitpid (pid_t pid, int *statusp, int options)
size_t wcsftime (wchar_t *buf, size_t bufsize, const wchar_t *format, const struct tm *tmbuf)
ssize_t write (int fd, const void *buf, size_t nbytes)
ssize_t writev (int fd, const struct iovec *iov, int iovcnt)

Variables

void(*)(int) signal (int signum, void(*act)(int))
void(*)(int) sigset (int signum, void(*act)(int))
int daylight
long timezone
char * tzname [2]


Function Documentation

void _exit int  status  ) 
 

Description:
Terminate process without clean-up (Std. UNIX; see AUP2 Sec. 5.7)
Headers:
unistd.h
Returns:
Does not return
Parameters:
status  exit status

Referenced by edinvoke(), execute3(), fcn(), fd_check(), handler(), invoke(), main(), redirect(), and sig_thread().

void _Exit int  status  ) 
 

Description:
Terminate process without clean-up (Std. UNIX; see AUP2 Sec. 5.7)
Headers:
stdlib.h
Returns:
Does not return
Parameters:
status  exit status

void _longjmp jmp_buf  loc_info,
int  val
 

Description:
Jump to jump point without restoring signal mask (Std. UNIX; see AUP2 Sec. 9.6)
Headers:
setjmp.h
Parameters:
loc_info  saved location information
val  value for setjmp to return

int _setjmp jmp_buf  loc_info  ) 
 

Description:
Set jump point (Std. UNIX; see AUP2 Sec. 9.6)
Headers:
setjmp.h
Returns:
0 if called directly, non-zero if from longjmp (no error return)
Parameters:
loc_info  saved location information

void abort void   ) 
 

Description:
Generate SIGABRT (Std. UNIX; see AUP2 Sec. 9.1.9)
Headers:
stdlib.h
Returns:
Does not return

int accept int  socket_fd,
struct sockaddr *  sa,
socklen_t *  sa_len
 

Description:
Accept new connection on socket and create new socket (Std. UNIX; see AUP2 Sec. 8.1.2)
Headers:
sys/socket.h
Returns:
file descriptor or -1 on error (sets errno)
Parameters:
socket_fd  socket file descriptor
sa  socket address or NULL
sa_len  address length

Referenced by main(), run_server(), and ssi_wait_server().

int access const char *  path,
int  what
 

Description:
Determine accessibility of file (Std. UNIX; see AUP2 Sec. 3.8.1)
R_OK read permission
W_OK write permission
X_OK execute (search) permission
F_OK test for existence
Headers:
unistd.h
Returns:
0 if allowed or -1 if not or on error (sets errno)
Parameters:
path  pathname
what  permission to be tested

Referenced by access_test(), find_and_open_master(), and main().

int aio_cancel int  fd,
struct aiocb aiocbp
 

Description:
Cancel asynchronous I/O request (Std. UNIX; see AUP2 Sec. 3.9.5)
Headers:
aio.h
Returns:
result code or -1 on error (sets errno)
Parameters:
fd  file descriptor
aiocbp  control block

int aio_error const struct aiocb aiocbp  ) 
 

Description:
Retrieve error status for asynchronous I/O operation (Std. UNIX; see AUP2 Sec. 3.9.4)
Headers:
aio.h
Returns:
0, errno value, or EINPROGRESS (does not set errno)
Parameters:
aiocbp  control block

Referenced by asynchronous(), and Ux::Aio::error().

int aio_fsync int  op,
struct aiocb aiocbp
 

Description:
Initiate buffer-cache flushing for one file (Std. UNIX; see AUP2 Sec. 3.9.6)
Headers:
aio.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
op  O_SYNC or O_DSYNC
aiocbp  control block

int aio_read struct aiocb aiocbp  ) 
 

Description:
Asynchronous read from file (Std. UNIX; see AUP2 Sec. 3.9.3)
Headers:
aio.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
aiocbp  control block

Referenced by asynchronous().

ssize_t aio_return struct aiocb aiocbp  ) 
 

Description:
Retrieve return status of asynchronous I/O operation (Std. UNIX; see AUP2 Sec. 3.9.4)
Headers:
aio.h
Returns:
operation return value or -1 on error (sets errno)
Parameters:
aiocbp  control block

int aio_suspend const struct aiocb *const  list[],
int  cbcnt,
const struct timespec timeout
 

Description:
Wait for asynchronous I/O request (Std. UNIX; see AUP2 Sec. 3.9.7)
Headers:
aio.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
list  array of control blocks
cbcnt  number of elements in array
timeout  max time to wait

Referenced by asynchronous().

int aio_write struct aiocb aiocbp  ) 
 

Description:
Asynchronous write to file (Std. UNIX; see AUP2 Sec. 3.9.3)
Headers:
aio.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
aiocbp  control block

unsigned alarm unsigned  secs  ) 
 

Description:
Schedule an alarm signal (Std. UNIX; see AUP2 Sec. 9.7.1)
Headers:
unistd.h
Returns:
seconds left on previous alarm or zero if none (no error return)
Parameters:
secs  seconds until signal

Referenced by Ux::Timer::alarm(), aup_sleep(), main(), posixsem_test(), and sysvsem_test().

char* asctime const struct tm tmbuf  ) 
 

Description:
Convert broken-down time to local-time string (Std. UNIX; see AUP2 Sec. 1.7.1)
Headers:
time.h
Returns:
string or NULL on error (errno not set)
Parameters:
tmbuf  broken-down time

int atexit void(*  fcn)(void)  ) 
 

Description:
Register function to be called when process exits (Std. UNIX; see AUP2 Sec. 1.3.4)
Headers:
stdlib.h
Returns:
0 on success, non-zero on error (errno not set)
Parameters:
fcn  function to be called

Referenced by ec_push(), and process_test().

int bind int  socket_fd,
const struct sockaddr *  sa,
socklen_t  sa_len
 

Description:
Bind name to socket (Std. UNIX; see AUP2 Sec. 8.1.2)
Headers:
sys/socket.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
socket_fd  socket file descriptor
sa  socket address
sa_len  address length

Referenced by main(), run_client(), run_server(), and ssi_open().

speed_t cfgetispeed const struct termios tp  ) 
 

Description:
Get input speed from termios structure (Std. UNIX; see AUP2 Sec. 4.5.3)
Headers:
termios.h
Returns:
speed (no error return)
Parameters:
tp  attributes

Referenced by Ux::Termios::cfgetispeed().

speed_t cfgetospeed const struct termios tp  ) 
 

Description:
Get output speed from termios structure (Std. UNIX; see AUP2 Sec. 4.5.3)
Headers:
termios.h
Returns:
speed (no error return)
Parameters:
tp  attributes

Referenced by Ux::Termios::cfgetospeed().

int cfsetispeed struct termios tp,
speed_t  speed
 

Description:
Set input speed in termios structure (Std. UNIX; see AUP2 Sec. 4.5.3)
Headers:
termios.h
Returns:
0 on success or -1 on error (may set errno)
Parameters:
tp  attributes
speed  speed

int cfsetospeed struct termios tp,
speed_t  speed
 

Description:
Set output speed in termios structure (Std. UNIX; see AUP2 Sec. 4.5.3)
Headers:
termios.h
Returns:
0 on success or -1 on error (may set errno)
Parameters:
tp  attributes
speed  speed

int chdir const char *  path  ) 
 

Description:
Change current directory by path (Std. UNIX; see AUP2 Sec. 3.6.2)
Headers:
unistd.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
path  pathname

Referenced by builtin(), do_dir(), getcwdx(), main(), and process_test().

int chmod const char *  path,
mode_t  mode
 

Description:
Change mode of file by path (Std. UNIX; see AUP2 Sec. 3.7.1)
Headers:
sys/stat.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
path  pathname
mode  new mode

int chown const char *  path,
uid_t  uid,
gid_t  gid
 

Description:
Change owner and group of file by path (Std. UNIX; see AUP2 Sec. 3.7.2)
Headers:
unistd.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
path  pathname
uid  new user ID
gid  new group ID

int chroot const char *  path  ) 
 

Description:
Change root directory (Std. UNIX; see AUP2 Sec. 5.14)
Headers:
unistd.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
path  path name

Referenced by process_test().

clock_t clock void   ) 
 

Description:
Get execution time (Std. UNIX; see AUP2 Sec. 1.7.2)
Headers:
time.h
Returns:
time in CLOCKS_PER_SEC or -1 on error (errno not set)

Referenced by Ux::RealtimeTimer::create(), getaddr(), Ux::Clock::getcpuclockid(), and main().

int clock_getcpuclockid pid_t  pid,
clockid_t *  clock_id
 

Description:
Get process CPU-time clock (Std. UNIX; see AUP2 Sec. 9.7.5)
Headers:
time.h
Returns:
0 on success or error number on error
Parameters:
pid  process ID
clock_id  returned clock ID

int clock_getres clockid_t  clock_id,
struct timespec res
 

Description:
Get clock resolution (Std. UNIX; see AUP2 Sec. 9.7.5)
Headers:
time.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
clock_id  clock ID
res  resolution

int clock_gettime clockid_t  clock_id,
struct timespec tp
 

Description:
Get time from clock (Std. UNIX; see AUP2 Sec. 9.7.5)
Headers:
time.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
clock_id  clock ID (CLOCK_REALTIME, etc.)
tp  time

int clock_nanosleep clockid_t  clock_id,
int  flags,
const struct timespec nsecs,
struct timespec remain
 

Description:
Suspend execution for nanoseconds or until signal (Std. UNIX; see AUP2 Sec. 9.7.5)
Headers:
time.h
Returns:
0 on success or error number on error
Parameters:
clock_id  clock ID
flags  TIMER_ABSTIME or zero
nsecs  nanoseconds to sleep
remain  remaining time

int clock_settime clockid_t  clock_id,
const struct timespec tp
 

Description:
Set clock (Std. UNIX; see AUP2 Sec. 9.7.5)
Headers:
time.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
clock_id  clock ID
tp  time

int close int  fd  ) 
 

Description:
Close file descriptor (Std. UNIX; see AUP2 Sec. 2.11)
Headers:
unistd.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
fd  file descriptor

Referenced by backward(), backward0(), backward2(), Bclose(), clients_close_all(), copy(), copy2(), copy2a(), do_dir(), edinvoke(), ev_close(), exec_redirected(), fcn(), fcntl_example(), file_ctime_test(), find_and_open_master(), fsort(), fsort0(), ftruncate_test(), getaddr(), getcwdx(), invoke(), junk(), lock(), main(), main1(), pcsync_end(), pipewrite(), pipewrite2(), pipewrite2bug(), process1(), process2(), pt_close_master(), pt_close_slave(), pt_open_master(), pt_open_slave(), pwrite_test(), readany_test(), readany_test2(), readany_test3(), redirect(), rmdir_test(), run_client(), run_server(), scatter(), setup_fdset(), showpginfo(), SimpleSemOpen(), smi_close_fifo(), smi_close_pshm(), smi_open_pshm(), smi_open_shm(), ssi_close(), ssi_close_fd(), synctest(), try6(), who_wc(), and who_wc2().

int closedir DIR *  dirp  ) 
 

Description:
Close directory (Std. UNIX; see AUP2 Sec. 3.6.1)
Headers:
dirent.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
dirp  DIR pointer from opendir

Referenced by do_dir(), getcwdx(), readdir_r_test(), and readdir_test().

size_t confstr int  name,
char *  buf,
size_t  len
 

Description:
Get configuration string (Std. UNIX; see AUP2 Sec. 1.5.7)
Headers:
unistd.h
Returns:
size of value or 0 on error (sets errno on error)
Parameters:
name  option or limit name
buf  returned string value
len  size of buf

Referenced by main().

int connect int  socket_fd,
const struct sockaddr *  sa,
socklen_t  sa_len
 

Description:
Connect socket (Std. UNIX; see AUP2 Sec. 8.1.2)
Headers:
sys/socket.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
socket_fd  socket file descriptor
sa  socket address
sa_len  address length

Referenced by main(), main1(), run_client(), and ssi_open().

int creat const char *  path,
mode_t  perms
 

Description:
Create or truncate a file for writing (Std. UNIX; see AUP2 Sec. 2.4.2)
Headers:
sys/stat.h , fcntl.h
Returns:
file descriptor or -1 on error (sets errno)
Parameters:
path  pathname
perms  permissions

Referenced by junk(), and main().

char* ctermid char *  buf  ) 
 

Description:
Get pathname for controlling terminal (Std. UNIX; see AUP2 Sec. 4.7)
Headers:
stdio.h
Returns:
pathname or empty string on error (errno not set)
Parameters:
buf  buffer of size L_ctermid or NULL

char* ctime const time_t *  t  ) 
 

Description:
Convert time_t to local-time string (Std. UNIX; see AUP2 Sec. 1.7.1)
Headers:
time.h
Returns:
string or NULL on error (errno not set)
Parameters:
t  time

Referenced by file_ctime_test(), and send_header_OK().

double difftime time_t  time1,
time_t  time0
 

Description:
Subtract two time_t values (Std. UNIX; see AUP2 Sec. 1.7.1)
Headers:
time.h
Returns:
time1 - time0 in seconds (no error return)
Parameters:
time1  time
time0  time

Referenced by Ux::TimeSec::diff(), Ux::Timet::difftime(), print_date(), and test_setblock().

int dup int  fd  ) 
 

Description:
Duplicate file descriptor (Std. UNIX; see AUP2 Sec. 6.3)
Headers:
unistd.h
Returns:
new file descriptor or -1 on error (sets errno)
Parameters:
fd  file descriptor to duplicate

int dup2 int  fd,
int  fd2
 

Description:
Duplicate file descriptor (Std. UNIX; see AUP2 Sec. 6.3)
Headers:
unistd.h
Returns:
new file descriptor or -1 on error (sets errno)
Parameters:
fd  file descriptor to duplicate
fd2  file descriptor to use

Referenced by edinvoke(), exec_redirected(), fsort(), fsort0(), pipewrite2(), pipewrite2bug(), redirect(), who_wc(), and who_wc2().

void endhostent void   ) 
 

Description:
End host-database scan (Std. UNIX; see AUP2 Sec. 8.8.1)
Headers:
netdb.h

Referenced by hostdb().

void endnetent void   ) 
 

Description:
End network-database scan (Std. UNIX; see AUP2 Sec. 8.8.2)
Headers:
netdb.h

Referenced by netdb().

void endprotoent void   ) 
 

Description:
End protocol-database scan (Std. UNIX; see AUP2 Sec. 8.8.3)
Headers:
netdb.h

Referenced by main(), and protodb().

void endservent void   ) 
 

Description:
End service-database scan (Std. UNIX; see AUP2 Sec. 8.8.4)
Headers:
netdb.h

Referenced by servdb().

int execl const char *  path,
const char *  arg0,
const char *  arg1,
...  ,
(char *)NULL 
 

Description:
Execute file with argument list (Std. UNIX; see AUP2 Sec. 5.3)
Headers:
unistd.h
Returns:
-1 on error (sets errno)
Parameters:
path  program pathname
arg0  first arg (file name)
arg1  second arg

Referenced by exectest(), and junk().

int execle const char *  path,
const char *  arg0,
const char *  arg1,
...  ,
(char *)NULL  ,
char *const envv  []
 

Description:
Execute file with argument list and environment (Std. UNIX; see AUP2 Sec. 5.3)
Headers:
unistd.h
Returns:
-1 on error (sets errno)
Parameters:
path  program pathname
arg0  first arg (file name)
arg1  second arg

int execlp const char *  file,
const char *  arg0,
const char *  arg1,
...  ,
(char *)NULL 
 

Description:
Execute file with argument list and PATH search (Std. UNIX; see AUP2 Sec. 5.3)
Headers:
unistd.h
Returns:
-1 on error (sets errno)
Parameters:
file  program file name
arg0  first arg (file name)
arg1  second arg

Referenced by edinvoke(), fsort(), fsort0(), pipewrite(), pipewrite2(), pipewrite2bug(), process_test(), who_wc(), and who_wc2().

int execv const char *  path,
char *const  argv[]
 

Description:
Execute file with argument vector (Std. UNIX; see AUP2 Sec. 5.3)
Headers:
unistd.h
Returns:
-1 on error (sets errno)
Parameters:
path  program pathname
argv  argument vector

Referenced by exec_path().

int execve const char *  path,
char *const  argv[],
char *const  envv[]
 

Description:
Execute file with argument vector and environment (Std. UNIX; see AUP2 Sec. 5.3)
Headers:
unistd.h
Returns:
-1 on error (sets errno)
Parameters:
path  program pathname
argv  argument vector
envv  environment vector

int execvp const char *  file,
char *const  argv[]
 

Description:
Execute file with argument vector and PATH search (Std. UNIX; see AUP2 Sec. 5.3)
Headers:
unistd.h
Returns:
-1 on error (sets errno)
Parameters:
file  program file name
argv  argument vector

Referenced by exec_redirected(), execute3(), Ux::Process::execvpe(), invoke(), and main().

void exit int  status  ) 
 

Description:
Terminate process with clean-up (Std. UNIX; see AUP2 Sec. 5.7)
Headers:
stdlib.h
Returns:
Does not return
Parameters:
status  exit status

Referenced by a1(), a3(), command(), display(), ec_mutex(), forkbuf(), get_and_incr_x(), init(), main(), main1(), process(), process1(), process2(), run_client(), run_server(), setup_fdset(), setup_posix_msg(), setup_posix_sem(), setup_process(), setup_signal(), setup_systemv_msg(), setup_systemv_sem(), socket_test_inet(), socket_test_unix(), sorter(), syserr(), tc_keystroke(), try1(), try2(), try3(), try4(), try5(), and try6().

int fchdir int  fd  ) 
 

Description:
Change current directory by file descriptor (Std. UNIX; see AUP2 Sec. 3.6.2)
Headers:
unistd.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
fd  file descriptor

Referenced by do_dir(), and getcwdx().

int fchmod int  fd,
mode_t  mode
 

Description:
Change mode of file by file descriptor (Std. UNIX; see AUP2 Sec. 3.7.1)
Headers:
sys/stat.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
fd  file descriptor
mode  new mode

Referenced by pt_open_slave().

int fchown int  fd,
uid_t  uid,
gid_t  gid
 

Description:
Change owner and group of file by file descriptor (Std. UNIX; see AUP2 Sec. 3.7.2)
Headers:
unistd.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
fd  file descriptor
uid  new user ID
gid  new group ID

int fcntl int  fd,
int  op,
... 
 

Description:
Control open file (Std. UNIX; see AUP2 Sec. 3.8.3)
Headers:
unistd.h , fcntl.h
Returns:
result depending on op or -1 on error (sets errno)
Parameters:
fd  file descriptor
op  operation

Referenced by fcntl_example(), fd_check(), init(), junk(), pipe_access_mode(), and setblock().

void FD_CLR int  fd,
fd_set *  fdset
 

Description:
Clear fd_set bit (Std. UNIX; see AUP2 Sec. 4.2.3)
Headers:
sys/select.h
Parameters:
fd  file descriptor to clear
fdset  fd_set

Referenced by run_server(), and ssi_close_fd().

int FD_ISSET int  fd,
fd_set *  fdset
 

Description:
Test fd_set bit (Std. UNIX; see AUP2 Sec. 4.2.3)
Headers:
sys/select.h
Returns:
1 if set or 0 if clear (no error return)
Parameters:
fd  file descriptor to test
fdset  fd_set

Referenced by main(), readany2(), readbuf(), run_server(), ssi_close(), ssi_wait_server(), and thread_fdset().

void FD_SET int  fd,
fd_set *  fdset
 

Description:
Set fd_set bit (Std. UNIX; see AUP2 Sec. 4.2.3)
Headers:
sys/select.h
Parameters:
fd  file descriptor to set
fdset  fd_set

Referenced by main(), pcsync_wait_for_parent(), pt_wait_master(), readany2(), readbuf(), run_server(), setup_fdset(), ssi_open(), and ssi_wait_server().

void FD_ZERO fd_set *  fdset  ) 
 

Description:
Clear entire fd_set (Std. UNIX; see AUP2 Sec. 4.2.3)
Headers:
sys/select.h
Parameters:
fdset  fd_set to clear

Referenced by main(), pcsync_wait_for_parent(), pt_wait_master(), readany2(), readbuf(), run_server(), setup_fdset(), and ssi_open().

int fdatasync int  fd  ) 
 

Description:
Force buffer-cache flushing for one fileís data (Std. UNIX; see AUP2 Sec. 2.16.2)
Headers:
unistd.h
Returns:
0 or -1 on error (sets errno)
Parameters:
fd  file descriptor

Referenced by main().

pid_t fork void   ) 
 

Description:
Create new process (Std. UNIX; see AUP2 Sec. 5.5)
Headers:
unistd.h
Returns:
childís process-ID and 0 on success or -1 on error (sets errno)

Referenced by edinvoke(), execute3(), forkbuf(), forktest(), fsort(), fsort0(), invoke(), main(), pipewrite(), pipewrite2(), pipewrite2bug(), process_test(), run_client(), setup_fdset(), setup_posix_msg(), setup_posix_sem(), setup_process(), setup_signal(), setup_systemv_msg(), setup_systemv_sem(), socket_test_inet(), socket_test_unix(), try1(), try2(), try3(), try4(), try5(), try6(), who_wc(), and who_wc2().

long fpathconf int  fd,
int  name
 

Description:
Get system option or limit by file descriptor (Std. UNIX; see AUP2 Sec. 1.5.6)
Headers:
unistd.h
Returns:
option/limit value or -1 (sets errno on error)
Parameters:
fd  file descriptor
name  option or limit name

Referenced by fpathconf_test(), and tc_setraw().

void freeaddrinfo struct addrinfo infop  ) 
 

Description:
Free socket-address information (Std. UNIX; see AUP2 Sec. 8.2.6)
Headers:
sys/socket.h , netdb.h
Parameters:
infop  list to free

Referenced by make_sockaddr().

int fstat int  fd,
struct stat buf
 

Description:
Get file info by file descriptor (Std. UNIX; see AUP2 Sec. 3.5.1)
Headers:
sys/stat.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
fd  file descriptor
buf  returned information

Referenced by check_parent(), and file_ctime_test().

int fstatvfs int  fd,
struct statvfs buf
 

Description:
Get file system information by file descriptor (Std. UNIX; see AUP2 Sec. 3.2.3)
Headers:
sys/statvfs.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
fd  file descriptor
buf  returned info

int fsync int  fd  ) 
 

Description:
Schedule or force buffer-cache flushing for one file (Std. UNIX; see AUP2 Sec. 2.16.2)
Headers:
unistd.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
fd  file descriptor

Referenced by main().

key_t ftok const char *  path,
int  id
 

Description:
Generate System V IPC key (Std. UNIX; see AUP2 Sec. 7.4.2)
Headers:
sys/ipc.h
Returns:
key on success or -1 on error (sets errno)
Parameters:
path  pathname of existing file
id  desired key number

Referenced by getaddr(), main(), setup_systemv_msg(), setup_systemv_sem(), SimpleSemOpen(), SimpleSemRemove(), smi_open_shm(), sysvmsg_test(), sysvsem_test(), and sysvshm_test().

int ftruncate int  fd,
off_t  length
 

Description:
Truncate or stretch file by file descriptor (Std. UNIX; see AUP2 Sec. 2.17)
Headers:
unistd.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
fd  file descriptor
length  new length

Referenced by ftruncate_test(), main(), and smi_open_pshm().

const char* gai_strerror int  code  ) 
 

Description:
Get error-code description (Std. UNIX; see AUP2 Sec. 8.2.6)
Headers:
netdb.h
Returns:
string (no error return)
Parameters:
code  error code

Referenced by a3(), syserrmsgline(), syserrmsgtype(), and Ux::Error::what().

int getaddrinfo const char *  nodename,
const char *  servname,
const struct addrinfo hint,
struct addrinfo **  infop
 

Description:
Get socket-address information (Std. UNIX; see AUP2 Sec. 8.2.6)
Headers:
sys/socket.h , netdb.h
Returns:
0 on success or error number on error (errno not set)
Parameters:
nodename  node name
servname  service name
hint  hint
infop  returned info as linked list

Referenced by a1(), a3(), main(), and make_sockaddr().

char* getcwd char *  buf,
size_t  bufsize
 

Description:
Get current directory pathname (Std. UNIX; see AUP2 Sec. 3.4.2)
Headers:
unistd.h
Returns:
pathname or NULL on error (sets errno)
Parameters:
buf  returned pathname
bufsize  size of buf

Referenced by get_cwd(), main(), and process_test().

struct tm* getdate const char *  s  ) 
 

Description:
Convert string to broken-down time with rules (Std. UNIX; see AUP2 Sec. 1.7.1)
Headers:
time.h
Returns:
broken-down time or NULL on error (sets getdate_err)
Parameters:
s  string to convert

gid_t getegid void   ) 
 

Description:
Get effective group ID (Std. UNIX; see AUP2 Sec. 5.11)
Headers:
unistd.h
Returns:
group ID (no error return)

Referenced by Ux::Process::getegid(), and main().

char* getenv const char *  var  ) 
 

Description:
Get value of environment variable (Std. UNIX; see AUP2 Sec. 5.2)
Headers:
stdlib.h
Returns:
value or NULL if not found (errno not set)
Parameters:
var  variable to find

Referenced by builtin(), execvp2(), Ux::Process::getenv(), and process_env_test().

uid_t geteuid void   ) 
 

Description:
Get effective user ID (Std. UNIX; see AUP2 Sec. 5.11)
Headers:
unistd.h
Returns:
user ID (no error return)

Referenced by Ux::Process::geteuid(), and main().

gid_t getgid void   ) 
 

Description:
Get real group ID (Std. UNIX; see AUP2 Sec. 5.11)
Headers:
unistd.h
Returns:
group ID (no error return)

Referenced by Ux::Process::getgid(), and main().

struct group* getgrgid gid_t  gid  ) 
 

Description:
Get group-file entry (Std. UNIX; see AUP2 Sec. 3.5.2)
Headers:
grp.h
Returns:
pointer to structure or NULL on error (sets errno)
Parameters:
gid  group ID

Referenced by Ux::System::getgrgid(), main(), and print_group().

struct hostent* gethostbyaddr const void *  addr,
socklen_t  len,
int  family
 

Description:
Lookup host by address (Std. UNIX; see AUP2 Sec. 8.8.1)
Headers:
netdb.h
Returns:
pointer to hostent or NULL on error (sets h_errno)
Parameters:
addr  IP address
len  length of address
family  family (called ďtypeĒ in SUS)

Referenced by gethostbyaddr_ex().

struct hostent* gethostbyname const char *  nodename  ) 
 

Description:
Lookup host by name (Std. UNIX; see AUP2 Sec. 8.8.1)
Headers:
netdb.h
Returns:
pointer to hostent or NULL on error (sets h_errno)
Parameters:
nodename  node name

Referenced by gethostbyname_ex().

struct hostent* gethostent void   ) 
 

Description:
Get next host-database entry (Std. UNIX; see AUP2 Sec. 8.8.1)
Headers:
netdb.h
Returns:
next entry or NULL on end of database (errno not set)

Referenced by Ux::Netdb::gethostent(), and hostdb().

long gethostid void   ) 
 

Description:
Get identifier for local host (Std. UNIX; see AUP2 Sec. 8.8.1)
Headers:
unistd.h
Returns:
identifier (no error return)

Referenced by Ux::System::gethostid(), and main().

int gethostname char *  name,
size_t  namelen
 

Description:
Get name of host (Std. UNIX; see AUP2 Sec. 8.2.7)
Headers:
unistd.h
Returns:
0 on success or -1 on error (errno not set)
Parameters:
name  returned name
namelen  size of name buffer

Referenced by main().

int getitimer int  which,
struct itimerval val
 

Description:
Get value of interval timer (Std. UNIX; see AUP2 Sec. 9.7.4)
Headers:
sys/time.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
which  timer to get
val  returned value

char* getlogin void   ) 
 

Description:
Get login name (Std. UNIX; see AUP2 Sec. 3.5.2)
Headers:
unistd.h
Returns:
name or NULL on error (sets errno)

int getnameinfo const struct sockaddr *  sa,
socklen_t  sa_len,
char *  nodename,
socklen_t  nodelen,
char *  servname,
socklen_t  servlen,
unsigned  flags
 

Description:
Get name information (Std. UNIX; see AUP2 Sec. 8.8.1)
Headers:
sys/socket.h , netdb.h
Returns:
0 on success or error number on error
Parameters:
sa  socket address
sa_len  socket-address length
nodename  node name
nodelen  node-name buffer length
servname  service name
servlen  service-name buffer length
flags  flags

Referenced by getnameinfo_ex().

struct netent* getnetbyaddr uint32_t  net,
int  type
 

Description:
Lookup network by number (Std. UNIX; see AUP2 Sec. 8.8.2)
Headers:
netdb.h
Returns:
pointer to netent or NULL if not found (errno not set)
Parameters:
net  network number (to match n_net member)
type  family (to match n_addrtype member)

Referenced by Ux::Netdb::getnetbyaddr().

struct netent* getnetbyname const char *  name  ) 
 

Description:
Lookup network by name (Std. UNIX; see AUP2 Sec. 8.8.2)
Headers:
netdb.h
Returns:
pointer to netent or NULL if not found (errno not set)
Parameters:
name  network name (to match n_name member)

Referenced by Ux::Netdb::getnetbyname().

struct netent* getnetent void   ) 
 

Description:
Get network-database entry (Std. UNIX; see AUP2 Sec. 8.8.2)
Headers:
netdb.h
Returns:
pointer to netent or NULL end of database (errno not set)

Referenced by Ux::Netdb::getnetent(), and netdb().

int getpeername int  socket_fd,
struct sockaddr *  sa,
socklen_t *  sa_len
 

Description:
Get socket address of connected socket (Std. UNIX; see AUP2 Sec. 8.9.2)
Headers:
sys/socket.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
socket_fd  socket file descriptor
sa  socket address
sa_len  address length

pid_t getpgid pid_t  pid  ) 
 

Description:
Get process-group ID (Std. UNIX; see AUP2 Sec. 4.3.3)
Headers:
unistd.h
Returns:
process-group ID or -1 on error (sets errno)
Parameters:
pid  process ID or 0 for calling process

Referenced by showpginfo().

pid_t getpid void   ) 
 

Description:
Get process ID (Std. UNIX; see AUP2 Sec. 5.13)
Headers:
unistd.h
Returns:
process ID (no error return)

Referenced by Ux::Process::getpid(), gp(), logfmt(), main(), msg_check(), run_client(), setup_fdset(), setup_posix_msg(), setup_posix_sem(), setup_signal(), setup_systemv_msg(), setup_systemv_sem(), showpginfo(), smi_close_fifo(), smi_open_fifo(), smi_open_mq(), smi_open_pshm(), smi_send_getaddr_pshm(), smi_send_release_fifo(), and testlock().

pid_t getppid void   ) 
 

Description:
Get parent process ID (Std. UNIX; see AUP2 Sec. 5.13)
Headers:
unistd.h
Returns:
parent process ID (no error return)

Referenced by Ux::Process::getppid(), setup_signal(), and showpginfo().

struct protoent* getprotobyname const char *  name  ) 
 

Description:
Lookup protocol by name (Std. UNIX; see AUP2 Sec. 8.8.3)
Headers:
netdb.h
Returns:
pointer to protoent or NULL if not found (errno not set)
Parameters:
name  protocol name

Referenced by Ux::Netdb::getprotobyname().

struct protoent* getprotobynumber int  proto  ) 
 

Description:
Lookup protocol by number (Std. UNIX; see AUP2 Sec. 8.8.3)
Headers:
netdb.h
Returns:
pointer to protoent or NULL if not found (errno not set)
Parameters:
proto  protocol number

Referenced by Ux::Netdb::getprotobynumber().

struct protoent* getprotoent void   ) 
 

Description:
Get protocol-database entry (Std. UNIX; see AUP2 Sec. 8.8.3)
Headers:
netdb.h
Returns:
pointer to protoent or NULL end of database (errno not set)

Referenced by Ux::Netdb::getprotoent(), main(), and protodb().

struct passwd* getpwuid uid_t  uid  ) 
 

Description:
Get password-file entry (Std. UNIX; see AUP2 Sec. 3.5.2)
Headers:
pwd.h
Returns:
pointer to structure or NULL on error (sets errno)
Parameters:
uid  user ID

Referenced by Ux::System::getpwuid(), main(), and print_owner().

int getrlimit int  resource,
struct rlimit rlp
 

Description:
Get resource limits (Std. UNIX; see AUP2 Sec. 5.16)
Headers:
sys/resource.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
resource  resource
rlp  returned limits

Referenced by main(), process_test(), and showlimit().

int getrusage int  who,
struct rusage r_usage
 

Description:
Get resource usage (Std. UNIX; see AUP2 Sec. 5.16)
Headers:
sys/resource.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
who  RUSAGE_SELF or RUSAGE_CHILDREN
r_usage  returned usage information

Referenced by process_test().

struct servent* getservbyname const char *  name,
const char *  proto
 

Description:
Lookup service by name (Std. UNIX; see AUP2 Sec. 8.8.4)
Headers:
netdb.h
Returns:
pointer to protoent or NULL if not found (errno not set)

Referenced by Ux::Netdb::getservbyname().

struct servent* getservbyport int  port,
const char *  proto
 

Description:
Lookup service by port (Std. UNIX; see AUP2 Sec. 8.8.4)
Headers:
netdb.h
Returns:
pointer to protoent or NULL if not found (errno not set)

Referenced by Ux::Netdb::getservbyport().

struct servent* getservent void   ) 
 

Description:
Get service-database entry (Std. UNIX; see AUP2 Sec. 8.8.4)
Headers:
netdb.h
Returns:
pointer to servent or NULL end of database (errno not set)

Referenced by Ux::Netdb::getservent(), and servdb().

pid_t getsid pid_t  pid  ) 
 

Description:
Get session ID (Std. UNIX; see AUP2 Sec. 4.3.2)
Headers:
unistd.h
Returns:
session ID or -1 on error (sets errno)
Parameters:
pid  process ID or 0 for calling process

Referenced by showpginfo().

int getsockname int  socket_fd,
struct sockaddr *  sa,
socklen_t *  sa_len
 

Description:
Get socket address (Std. UNIX; see AUP2 Sec. 8.9.2)
Headers:
sys/socket.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
socket_fd  socket file descriptor
sa  socket address
sa_len  address length

int getsockopt int  socket,
int  level,
int  option,
const void *  value,
socklen_t *  value_len
 

Description:
Get the socket options (Std. UNIX; see AUP2 Sec. 8.3)
Headers:
sys/socket.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
socket  socket
level  level to be accessed
option  option to set
value  value to set
value_len  length of value

Referenced by show().

int gettimeofday struct timeval tvalbuf,
void *  dummy
 

Description:
Get current date and time as timeval (Std. UNIX; see AUP2 Sec. 1.7.1)
Headers:
sys/time.h
Returns:
0 on success or -1 (maybe) on error (may set errno)
Parameters:
tvalbuf  returned time
dummy  always NULL

Referenced by get_rel_time(), and main().

uid_t getuid void   ) 
 

Description:
Get real user ID (Std. UNIX; see AUP2 Sec. 5.11)
Headers:
unistd.h
Returns:
user ID (no error return)

Referenced by Ux::Process::getuid(), and main().

struct tm* gmtime const time_t *  t  ) 
 

Description:
Convert time_t to UTC broken-down time (Std. UNIX; see AUP2 Sec. 1.7.1)
Headers:
time.h
Returns:
broken-down time (no error return)
Parameters:
t  time

int grantpt int  fd  ) 
 

Description:
Get access to slave side of pty (Std. UNIX; see AUP2 Sec. 4.10.1)
Headers:
stdlib.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
fd  file descriptor

Referenced by pt_open_master().

uint32_t htonl uint32_t  hostnum  ) 
 

Description:
Convert 32-bit value from host to network byte order (Std. UNIX; see AUP2 Sec. 8.1.4)
Headers:
arpa/inet.h
Returns:
number in network byte order (no error return)
Parameters:
hostnum  32-bit number in host byte order

Referenced by Ux::Netdb::htonl(), main1(), and msg_check().

uint16_t htons uint16_t  hostnum  ) 
 

Description:
Convert 16-bit value from host to network byte order (Std. UNIX; see AUP2 Sec. 8.1.4)
Headers:
arpa/inet.h
Returns:
number in network byte order (no error return)
Parameters:
hostnum  16-bit number in host byte order

Referenced by getnameinfo_ex(), Ux::Netdb::htons(), main(), and main1().

void if_freenameindex struct if_nameindex ptr  ) 
 

Description:
Free array allocated by if_nameindex (Std. UNIX; see AUP2 Sec. 8.8.5)
Headers:
net/if.h
Parameters:
ptr  pointer to array

Referenced by ifdb().

char* if_indextoname unsigned  ifindex,
char *  ifname
 

Description:
Map network interface index to name (Std. UNIX; see AUP2 Sec. 8.8.5)
Headers:
net/if.h
Returns:
name or NULL on error (sets errno)
Parameters:
ifindex  interface index
ifname  interface name

struct if_nameindex* if_nameindex void   ) 
 

Description:
Get all network interface names and indexes (Std. UNIX; see AUP2 Sec. 8.8.5)
Headers:
net/if.h
Returns:
array or NULL on error (sets errno)

Referenced by ifdb().

unsigned if_nametoindex const char *  ifname  ) 
 

Description:
Map network interface name to index (Std. UNIX; see AUP2 Sec. 8.8.5)
Headers:
net/if.h
Returns:
index or 0 on error (errno not set)
Parameters:
ifname  interface name

in_addr_t inet_addr const char *  cp  ) 
 

Description:
Convert dotted IPv4 address string to integer (Std. UNIX; see AUP2 Sec. 8.2.3)
Headers:
arpa/inet.h
Returns:
IP address or (in_addr_t)-1 on error (errno not set)
Parameters:
cp  dotted IP address

Referenced by gethostbyaddr_ex(), getnameinfo_ex(), and main().

char* inet_ntoa struct in_addr  in  ) 
 

Description:
Convert integer IPv4 address to dotted string (Std. UNIX; see AUP2 Sec. 8.2.3)
Headers:
arpa/inet.h
Returns:
string (no error return)
Parameters:
in  integer address

Referenced by display_hostent(), and main().

const char* inet_ntop int  domain,
const void *  src,
char *  dst,
socklen_t  dst_len
 

Description:
Convert IPv4 or IPv6 binary addresses to string (Std. UNIX; see AUP2 Sec. 8.9.5)
Headers:
arpa/inet.h
Returns:
string or NULL on error (sets errno)
Parameters:
domain  AF_INET or AF_INET6
src  pointer to binary address (input)
dst  string (output)
dst_len  length of dst buffer

Referenced by cvt().

int inet_pton int  domain,
const char *  src,
void *  dst
 

Description:
Convert IPv4 or IPv6 string addresses to binary (Std. UNIX; see AUP2 Sec. 8.9.5)
Headers:
arpa/inet.h
Returns:
1 on success, 0 on invalid string, or -1 on error (sets errno)
Parameters:
domain  AF_INET or AF_INET6
src  string (input)
dst  buffer for binary address (output)

Referenced by cvt().

int ioctl int  fd,
int  req,
... 
 

Description:
Control a character device (Std. UNIX; see AUP2 Sec. 4.4)
Headers:
...
Returns:
-1 on error (sets errno); some other value on success
Parameters:
fd  file descriptor
req  request

Referenced by pt_open_slave().

int isatty int  fd  ) 
 

Description:
Test for a terminal (Std. UNIX; see AUP2 Sec. 4.7)
Headers:
unistd.h
Returns:
1 if a terminal and 0 if not (may set errno on 0 return)
Parameters:
fd  file descriptor

Referenced by Ux::Terminal::isatty().

int kill pid_t  pid,
int  signum
 

Description:
Generate signal for processes (Std. UNIX; see AUP2 Sec. 9.1.9)
Headers:
signal.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
pid  process ID or other specification
signum  signal

Referenced by main(), pcsync_unblock_children(), setup_signal(), try2(), try3(), try4(), and try5().

int killpg pid_t  pgrp,
int  signum
 

Description:
Generate signal for process group (Std. UNIX; see AUP2 Sec. 9.1.9)
Headers:
signal.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
pgrp  process-group ID
signum  signal

int lchown const char *  path,
uid_t  uid,
gid_t  gid
 

Description:
Change owner and group of symbolic link by path (Std. UNIX; see AUP2 Sec. 3.7.2)
Headers:
unistd.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
path  pathname
uid  user ID
gid  group ID

int link const char *  oldpath,
const char *  newpath
 

Description:
Create hard link (Std. UNIX; see AUP2 Sec. 3.3.1)
Headers:
unistd.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
oldpath  old pathname
newpath  new pathname

Referenced by add_link(), display(), and main().

int lio_listio int  mode,
struct aiocb *const  list[],
int  cbcnt,
struct sigevent sig
 

Description:
List-directed I/O (Std. UNIX; see AUP2 Sec. 3.9.9)
Headers:
aio.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
mode  LIO_WAIT or LIO_NOWAIT
list  array of control blocks
cbcnt  number of elements in array
sig  NULL or signal to generate

int listen int  socket_fd,
int  backlog
 

Description:
Mark socket for accepting and set queue limit (Std. UNIX; see AUP2 Sec. 8.1.2)
Headers:
sys/socket.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
socket_fd  socket file descriptor
backlog  maximum connection queue length

Referenced by main(), run_server(), and ssi_open().

struct tm* localtime const time_t *  t  ) 
 

Description:
Convert time_t to local broken-down time (Std. UNIX; see AUP2 Sec. 1.7.1)
Headers:
time.h
Returns:
broken-down time (no error return)
Parameters:
t  time

Referenced by logfmt(), and print_date().

int lockf int  fd,
int  op,
off_t  len
 

Description:
Lock section of file (Std. UNIX; see AUP2 Sec. 7.11.3)
Headers:
unistd.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
fd  file descriptor
op  operation
len  length of section

Referenced by main(), process2(), and store().

void longjmp jmp_buf  loc_info,
int  val
 

Description:
Jump to jump point (Std. UNIX; see AUP2 Sec. 9.6)
Headers:
setjmp.h
Parameters:
loc_info  saved location information
val  value for setjmp to return

Referenced by fcn2().

off_t lseek int  fd,
off_t  pos,
int  whence
 

Description:
Set and get file offset (Std. UNIX; see AUP2 Sec. 2.13)
Headers:
unistd.h
Returns:
new file offset or -1 on error (sets errno)
Parameters:
fd  file descriptor
pos  position
whence  interpretation

Referenced by backward(), backward0(), backward2(), file_ctime_test(), junk(), main(), process2(), pwrite_test(), scatter(), and store().

int lstat const char *  path,
struct stat buf
 

Description:
Get file info by path without following symbolic link (Std. UNIX; see AUP2 Sec. 3.5.1)
Headers:
sys/stat.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
path  pathname
buf  returned information

Referenced by check_parent(), do_entry(), getcwdx(), ls_one(), main(), and runtest().

int mkdir const char *  path,
mode_t  perms
 

Description:
Make directory (Std. UNIX; see AUP2 Sec. 3.6.3)
Headers:
sys/stat.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
path  pathname
perms  permissions

Referenced by main(), and rmdir_test().

int mkfifo const char *  path,
mode_t  perms
 

Description:
Make a FIFO (Std. UNIX; see AUP2 Sec. 7.2.1)
Headers:
sys/stat.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
path  pathname
perms  permissions

Referenced by main(), and smi_open_fifo().

int mknod const char *  path,
mode_t  perms,
dev_t  dev
 

Description:
Make file (Std. UNIX; see AUP2 Sec. 3.8.2)
Headers:
sys/stat.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
path  pathname
perms  mode
dev  device-ID

int mkstemp char *  template  ) 
 

Description:
Create and open file with unique name (Std. UNIX; see AUP2 Sec. 2.7)
Headers:
stdlib.h
Returns:
open file descriptor or -1 on error (may not set errno)
Parameters:
template  template for file name

Referenced by junk().

time_t mktime struct tm tmbuf  ) 
 

Description:
Convert local broken-down time to time_t (Std. UNIX; see AUP2 Sec. 1.7.1)
Headers:
time.h
Returns:
time or -1 on error (errno not set)
Parameters:
tmbuf  broken-down time

void* mmap void *  addr,
size_t  len,
int  prot,
int  flags,
int  fd,
off_t  off
 

Description:
Map pages of memory (Std. UNIX; see AUP2 Sec. 7.14.1)
Headers:
sys/mman.h
Returns:
pointer to segment or MAP_FAILED on error (sets errno)
Parameters:
addr  desired address or NULL
len  length of segment
prot  protection (see below)
flags  flags
fd  file descriptor
off  offset in file or shared-memory object

Referenced by get_client(), and smi_open_pshm().

int mount const char *  source,
const char *  target,
const char *  type,
unsigned long  flags,
const void *  data
 

Description:
Mount file system (non-standard) (Std. UNIX; see AUP2 Sec. 3.2.4)
Headers:
sys/mount.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
source  device
target  directory
type  type (e.g., ext2)
flags  mount flags (e.g., MS_RDONLY)
data  file-system-dependent data

int mq_close mqd_t  mqd  ) 
 

Description:
Close message queue (Std. UNIX; see AUP2 Sec. 7.7.1)
Headers:
mqueue.h
Returns:
zero on success or -1 on error (sets errno)
Parameters:
mqd  message-queue descriptor

int mq_getattr mqd_t  mqd,
struct mq_attr attr
 

Description:
Get message-queue attributes (Std. UNIX; see AUP2 Sec. 7.7.1)
Headers:
mqueue.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
mqd  message-queue descriptor
attr  attributes

int mq_notify mqd_t  mqd,
const struct sigevent ep
 

Description:
Register or unregister for message notification (Std. UNIX; see AUP2 Sec. 7.7.1)
Headers:
mqueue.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
mqd  message-queue descriptor
ep  notification

mqd_t mq_open const char *  name,
int  flags
 

Description:
Open message-queue (Std. UNIX; see AUP2 Sec. 7.7.1)
mqd_t mq_open(
const char *name, POSIX IPC name
int flags, flags (including O_CREAT)
mode_t perms, permissions
struct mq_attr *attr attributes (or NULL)
);
Headers:
mqueue.h
Returns:
message-queue descriptor or -1 on error (sets errno)
Parameters:
name  POSIX IPC name
flags  flags (excluding O_CREAT)

ssize_t mq_receive mqd_t  mqd,
char *  msg,
size_t  msgsize,
unsigned *  priorityp
 

Description:
Receive message (Std. UNIX; see AUP2 Sec. 7.7.1)
Headers:
mqueue.h
Returns:
size of message or -1 on error (sets errno)
Parameters:
mqd  message-queue descriptor
msg  message buffer
msgsize  size of message buffer
priorityp  returned priority or NULL

int mq_send mqd_t  mqd,
const char *  msg,
size_t  msgsize,
unsigned  priority
 

Description:
Send message (Std. UNIX; see AUP2 Sec. 7.7.1)
Headers:
mqueue.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
mqd  message-queue descriptor
msg  message
msgsize  size of message
priority  priority

int mq_setattr mqd_t  mqd,
const struct mq_attr attr,
struct mq_attr oldattr
 

Description:
Set message queue attributes (REALTIME) (Std. UNIX; see AUP2 Sec. 7.7.1)
Headers:
mqueue.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
mqd  message-queue descriptor
attr  new attributes
oldattr  old attributes

ssize_t mq_timedreceive mqd_t  mqd,
char *  msg,
size_t  msgsize,
unsigned *priorityp const struct timespec tmout
 

Description:
Receive message with timeout (Std. UNIX; see AUP2 Sec. 7.7.1)
Headers:
mqueue.h , mqueue.h , time.h
Returns:
size of message or -1 on error (sets errno)
Parameters:
mqd  message-queue descriptor
msg  message buffer
msgsize  size of message buffer
tmout  returned priority or NULL timeout

int mq_timedsend mqd_t  mqd,
const char *  msg,
size_t  msgsize,
unsigned priority const struct timespec tmout
 

Description:
Send message with timeout (Std. UNIX; see AUP2 Sec. 7.7.1)
Headers:
mqueue.h , mqueue.h , time.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
mqd  message-queue descriptor
msg  message
msgsize  size of message
tmout  priority timeout

int mq_unlink const char *  name  ) 
 

Description:
Remove message queue (Std. UNIX; see AUP2 Sec. 7.7.1)
Headers:
mqueue.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
name  POSIX IPC name

int msgctl int  msqid,
int  cmd,
struct msqid_ds data
 

Description:
Control message queue (Std. UNIX; see AUP2 Sec. 7.5.1)
Headers:
sys/msg.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
msqid  identifier
cmd  command
data  data for command

Referenced by main(), and setup_systemv_msg().

int msgget key_t  key,
int  flags
 

Description:
Get message-queue identifier (Std. UNIX; see AUP2 Sec. 7.5.1)
Headers:
sys/msg.h
Returns:
identifier or -1 on error (sets errno)
Parameters:
key  key
flags  creation flags

Referenced by main(), and setup_systemv_msg().

ssize_t msgrcv int  msqid,
const void *  msgp,
size_t  mtextsize,
long  msgtype,
int  flags
 

Description:
Receive message (Std. UNIX; see AUP2 Sec. 7.5.1)
Headers:
sys/msg.h
Returns:
number of bytes placed in mtext or -1 on error (sets errno)
Parameters:
msqid  identifier
msgp  message
mtextsize  size of mtext buffer
msgtype  message type requested
flags  flags

Referenced by thread_svmsg().

int msgsnd int  msqid,
const void *  msgp,
size_t  msgsize,
int  flags
 

Description:
Send message (Std. UNIX; see AUP2 Sec. 7.5.1)
Headers:
sys/msg.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
msqid  identifier
msgp  message
msgsize  size of message
flags  flags

Referenced by main(), and setup_systemv_msg().

int munmap void *  addr,
size_t  len
 

Description:
Unmap pages of memory (Std. UNIX; see AUP2 Sec. 7.14.1)
Headers:
sys/mman.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
addr  pointer to segment
len  length of segment

Referenced by smi_close_pshm().

int nanosleep const struct timespec nsecs,
struct timespec remain
 

Description:
Suspend execution for nanoseconds or until signal (Std. UNIX; see AUP2 Sec. 9.7.3)
Headers:
time.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
nsecs  nanoseconds to sleep
remain  remaining time

Referenced by thread_heartbeat().

int nice int  incr  ) 
 

Description:
Change nice value (Std. UNIX; see AUP2 Sec. 5.15)
Headers:
unistd.h
Returns:
old nice value - NZERO or -1 on error (sets errno)
Parameters:
incr  increment

Referenced by main(), and process_test().

uint32_t ntohl uint32_t  netnum  ) 
 

Description:
Convert 32-bit value from network to host byte order (Std. UNIX; see AUP2 Sec. 8.1.4)
Headers:
arpa/inet.h
Returns:
number in host byte order (no error return)
Parameters:
netnum  32-bit number in network byte order

Referenced by msg_check(), and Ux::Netdb::ntohl().

uint16_t ntohs uint16_t  netnum  ) 
 

Description:
Convert 16-bit value from network to host byte order (Std. UNIX; see AUP2 Sec. 8.1.4)
Headers:
arpa/inet.h
Returns:
number in host byte order (no error return)
Parameters:
netnum  16-bit number in network byte order

Referenced by main(), and Ux::Netdb::ntohs().

int open const char *  path,
int  flags,
mode_t  perms
 

Description:
Open or create a file (Std. UNIX; see AUP2 Sec. 2.4)
Headers:
sys/stat.h , fcntl.h
Returns:
file descriptor or -1 on error (sets errno)
Parameters:
path  pathname
flags  flags
perms  permissions (when creating)

Referenced by asynchronous(), backward(), backward0(), backward2(), Bopen_internal(), buildfile(), copy(), copy2(), copy2a(), dir_read_test(), do_dir(), ev_creat(), ev_open(), fcn(), fcntl_example(), file_ctime_test(), find_and_open_master(), fsort(), fsort0(), ftruncate_test(), getaddr(), getcwdx(), gp(), junk(), lock(), main(), process1(), process2(), pt_open_slave(), pwrite_test(), readany_test(), readany_test2(), readany_test3(), redirect(), rmdir_test(), scatter(), showpginfo(), SimpleSemOpen(), smi_open_fifo(), smi_open_shm(), smi_receive_getaddr_fifo(), synchronous(), synctest(), and temp_open().

DIR* opendir const char *  path  ) 
 

Description:
Open directory (Std. UNIX; see AUP2 Sec. 3.6.1)
Headers:
dirent.h
Returns:
DIR pointer or NULL on error (sets errno)
Parameters:
path  directory pathname

Referenced by do_dir(), getcwdx(), readdir_r_test(), and readdir_test().

long pathconf const char *  path,
int  name
 

Description:
Get system option or limit by path (Std. UNIX; see AUP2 Sec. 1.5.6)
Headers:
unistd.h
Returns:
option/limit value or -1 (sets errno on error)
Parameters:
path  pathname
name  option or limit name

Referenced by get_max_pathname(), main(), option_async_io(), option_sync_io(), and readdir_r_test().

int pause void   ) 
 

Description:
Wait for signal (Std. UNIX; see AUP2 Sec. 9.2.1)
Headers:
unistd.h
Returns:
-1 on error (sets errno)

Referenced by aup_sleep(), main(), process_test(), try2(), and try3().

int pipe int  pfd[2]  ) 
 

Description:
Create pipe (Std. UNIX; see AUP2 Sec. 6.2.1)
Headers:
unistd.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
pfd  file descriptors

Referenced by command(), edinvoke(), fpathconf_test(), fsort(), fsort0(), pcsync_init(), pipe_access_mode(), pipe_test(), pipetest(), pipewrite(), pipewrite2(), pipewrite2bug(), setup_fdset(), socket_test_inet(), socket_test_unix(), try6(), who_wc(), and who_wc2().

int poll struct pollfd  fdinfo[],
nfds_t  nfds,
int  timeout
 

Calls poll.

Parameters:
fdinfo  info on file descriptors to be tested
nfds  number of elements in fdinfo array
timeout  time-out (milliseconds)

Definition at line 276 of file uxfile.cpp.

References errno.

Referenced by readany3().

int posix_openpt int  oflag  ) 
 

Description:
Open pty (Std. UNIX; see AUP2 Sec. 4.10.1)
Headers:
stdlib.h , fcntl.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
oflag  O_RDWR optionally ORed with O_NOCTTY

Referenced by find_and_open_master().

ssize_t pread int  fd,
void *  buf,
size_t nbytes off_t  offset
 

Description:
Read from file descriptor at offset (Std. UNIX; see AUP2 Sec. 2.14)
Headers:
unistd.h
Returns:
number of bytes read or -1 on error (sets errno)
Parameters:
fd  file descriptor
buf  address to receive data
offset  amount to read where to read

Referenced by backward2(), and readrec().

int pselect int  nfds,
fd_set *  readset,
fd_set *  writeset,
fd_set *  errorset,
const struct timespec timeout,
const sigset_t *  sigmask
 

Calls pselect.

Parameters:
nfds  highest fd + 1
readset  read set or NULL
writeset  write set or NULL
errorset  error set or NULL
timeout  time-out (nanoseconds) or NULL
sigmask  signal mask

Definition at line 288 of file uxfile.cpp.

References errno.

int pthread_cancel pthread_t  thread_id  ) 
 

Description:
Cancel thread (Std. UNIX; see AUP2 Sec. 5.17.5)
Headers:
pthread.h
Returns:
0 on success, error number on failure
Parameters:
thread_id  ID of thread to cancel

Referenced by main(), and uem_unregister().

void pthread_cleanup_pop int  execute  ) 
 

Description:
Uninstall cleanup handler (Std. UNIX; see AUP2 Sec. 5.17.5)
Headers:
pthread.h
Parameters:
execute  execute handler?

Referenced by thread_fdset(), thread_func(), thread_heartbeat(), thread_process(), thread_signal(), thread_svmsg(), and thread_svsem().

void pthread_cleanup_push void(*  handler)(void *),
void *  arg
 

Description:
Install cleanup handler (Std. UNIX; see AUP2 Sec. 5.17.5)
Headers:
pthread.h
Parameters:
handler  pointer to cleanup-handler function
arg  data to pass to function

Referenced by thread_fdset(), thread_func(), thread_heartbeat(), thread_process(), thread_signal(), thread_svmsg(), and thread_svsem().

int pthread_cond_signal pthread_cond_t *  cond  ) 
 

Description:
Signal condition (Std. UNIX; see AUP2 Sec. 5.17.4)
Headers:
pthread.h
Returns:
0 on success, error number on failure
Parameters:
cond  condition variable

Referenced by main(), and queue_event().

int pthread_cond_wait pthread_cond_t *  cond,
pthread_mutex_t *  mutex
 

Description:
Wait for condition (Std. UNIX; see AUP2 Sec. 5.17.4)
Headers:
pthread.h
Returns:
0 on success, error number on failure
Parameters:
cond  condition variable

Referenced by thread_func(), and uem_wait().

int pthread_create pthread_t *  thread_id,
const pthread_attr_t *  attr,
void *(*  start_fcn)(void *),
void *  arg
 

Description:
Create a thread (Std. UNIX; see AUP2 Sec. 5.17.1)
Headers:
pthread.h
Returns:
0 on success, error number on failure
Parameters:
thread_id  new threadís ID
attr  attributes (or NULL)
start_fcn  starting function
arg  arg to starting function

Referenced by handle_signals(), main(), uem_register_fdset(), uem_register_heartbeat(), uem_register_process(), uem_register_signal(), uem_register_svmsg(), and uem_register_svsem().

int pthread_join pthread_t  thread_id,
void **  status_ptr
 

Description:
Wait for thread to terminate (Std. UNIX; see AUP2 Sec. 5.17.2)
Headers:
pthread.h
Returns:
0 on success, error number on failure
Parameters:
thread_id  ID of thread to join
status_ptr  NULL or returned exit status

Referenced by main().

int pthread_kill pthread_t  thread_id,
int  signum
 

Description:
Generate signal for thread (Std. UNIX; see AUP2 Sec. 9.1.9)
Headers:
signal.h
Returns:
0 on success, error number on failure (errno not set)
Parameters:
thread_id  thread ID
signum  signal

int pthread_mutex_lock pthread_mutex_t *  mutex  ) 
 

Description:
Lock mutex (Std. UNIX; see AUP2 Sec. 5.17.3)
Headers:
pthread.h
Returns:
0 on success, error number on failure
Parameters:
mutex  mutex to lock

Definition at line 24 of file pthreadstub.c.

Referenced by dequeue_event(), ec_mutex(), get_and_incr_x(), main(), queue_event(), sorter(), thread_fdset(), thread_func(), and uem_wait().

int pthread_mutex_unlock pthread_mutex_t *  mutex  ) 
 

Description:
Unlock mutex (Std. UNIX; see AUP2 Sec. 5.17.3)
Headers:
pthread.h
Returns:
0 on success, error number on failure
Parameters:
mutex  mutex to unlock

Definition at line 34 of file pthreadstub.c.

Referenced by cleanup_handler(), dequeue_event(), ec_mutex(), get_and_incr_x(), main(), queue_event(), sorter(), thread_fdset(), thread_func(), and uem_wait().

int pthread_sigmask int  how,
const sigset_t *  set,
sigset_t *  oset
 

Description:
Change threadís signal mask (Std. UNIX; see AUP2 Sec. 9.1.5)
Headers:
Returns:
0 on success, error number on failure (errno not set)
Parameters:
how  how signal mask is to be changed
set  input set
oset  previous signal mask

Referenced by handle_signals(), uem_bgn(), and uem_register_signal().

void pthread_testcancel void   ) 
 

Description:
Test for cancellation (Std. UNIX; see AUP2 Sec. 5.17.5)
Headers:
pthread.h

char* ptsname int  fd  ) 
 

Description:
Get name of slave side of pty (Std. UNIX; see AUP2 Sec. 4.10.1)
Headers:
stdlib.h
Returns:
name or NULL on error (errno not set)
Parameters:
fd  file descriptor

Referenced by pt_open_master().

int putenv char *  string  ) 
 

Description:
Change or add to environment (Std. UNIX; see AUP2 Sec. 5.2)
Headers:
stdlib.h
Returns:
0 on success or non-zero on error (sets errno)
Parameters:
string  string of form name=value

Referenced by process_env_test().

ssize_t pwrite int  fd,
const void *  buf,
size_t nbytes off_t  offset
 

Description:
Write to file descriptor at offset (Std. UNIX; see AUP2 Sec. 2.14)
Headers:
unistd.h
Returns:
number of bytes written or -1 on error (sets errno)
Parameters:
fd  file descriptor
buf  data to write
offset  amount to write where to write

Referenced by pwrite_test(), and writerec().

int raise int  signum  ) 
 

Description:
Generate signal for process (Std. UNIX; see AUP2 Sec. 9.1.9)
Headers:
signal.h
Returns:
0 on success or non-zero on error (sets errno)
Parameters:
signum  signal

ssize_t read int  fd,
void *  buf,
size_t  nbytes
 

Description:
Read from file descriptor (Std. UNIX; see AUP2 Sec. 2.10)
Headers:
unistd.h
Returns:
number of bytes read or -1 on error (sets errno)
Parameters:
fd  file descriptor
buf  address to receive data
nbytes  amount to read

Referenced by asynchronous(), backward(), backward0(), cget(), copy(), copy2(), copy2a(), cready(), dir_read_test(), ev_read(), fsort(), fsort0(), getch(), getln(), getln2(), junk(), main(), main1(), pcsync_unblock_children(), pipetest(), readall(), readany(), readany2(), readany3(), readbuf(), run_client(), run_server(), scatter(), setup_fdset(), smi_receive_getaddr_fifo(), synchronous(), tc_keystroke(), test_setblock(), and try6().

struct dirent* readdir DIR *  dirp  ) 
 

Description:
Read directory (Std. UNIX; see AUP2 Sec. 3.6.1)
Headers:
dirent.h
Returns:
structure or NULL on EOF or error (sets errno)
Parameters:
dirp  DIR pointer from opendir

Referenced by do_dir(), getcwdx(), and readdir_test().

int readdir_r DIR *restrict  dirp,
struct dirent entry,
struct dirent **  result
 

Description:
Read a directory (Std. UNIX; see AUP2 Sec. 3.6.1)
Headers:
dirent.h
Returns:
0 on success or error number on error (sets errno)
Parameters:
dirp  DIR pointer from opendir
entry  structure to hold entry
result  result (pointer or NULL)

Referenced by readdir_r_test().

ssize_t readlink const char *  path,
char *  buf,
size_t  bufsize
 

Description:
Read a symbolic link (Std. UNIX; see AUP2 Sec. 3.3.3)
Headers:
unistd.h
Returns:
byte count or -1 on error (sets errno)
Parameters:
path  pathname
buf  returned text
bufsize  buffer size

Referenced by print_name().

ssize_t readv int  fd,
const struct iovec iov,
int  iovcnt
 

Description:
Scatter read (Std. UNIX; see AUP2 Sec. 2.15)
Headers:
sys/uio.h
Returns:
number of bytes read or -1 on error (sets errno)
Parameters:
fd  file descriptor
iov  vector of data buffers
iovcnt  number of elements

Referenced by main().

ssize_t recv int  socket_fd,
void *  buffer,
size_t  length,
int  flags
 

Description:
Receive data from socket (Std. UNIX; see AUP2 Sec. 8.9.1)
Headers:
sys/socket.h
Returns:
number of bytes received, 0, or -1 on error (sets errno)
Parameters:
socket_fd  socket file descriptor
buffer  buffer to receive data
length  length of buffer
flags  flags

ssize_t recvfrom int  socket_fd,
void *  buffer,
size_t  length,
int  flags,
struct sockaddr *  sa,
socklen_t *  sa_len
 

Description:
Receive message from socket (Std. UNIX; see AUP2 Sec. 8.6.2)
Headers:
sys/socket.h
Returns:
number of bytes received, 0, or -1 on error (sets errno)
Parameters:
socket_fd  socket file descriptor
buffer  buffer for received message
length  length of buffer
flags  flags
sa  address of sender
sa_len  address length

Referenced by run_server().

ssize_t recvmsg int  socket_fd,
struct msghdr message,
int  flags
 

Description:
Receive a message from a socket (Std. UNIX; see AUP2 Sec. 8.6.3)
Headers:
sys/socket.h
Returns:
number of bytes received, 0, or -1 on error (sets errno)
Parameters:
socket_fd  socket file descriptor
message  message
flags  flags

Referenced by run_server().

int rename const char *  oldpath,
const char *  newpath
 

Description:
Rename a file (Std. UNIX; see AUP2 Sec. 3.3.2)
Headers:
stdio.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
oldpath  old pathname
newpath  new pathname

void rewinddir DIR *  dirp  ) 
 

Description:
Rewind directory (Std. UNIX; see AUP2 Sec. 3.6.1)
Headers:
dirent.h
Parameters:
dirp  DIR pointer from opendir

Referenced by do_dir().

int rmdir const char *  path  ) 
 

Description:
Remove directory (Std. UNIX; see AUP2 Sec. 3.6.3)
Headers:
unistd.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
path  pathname

Referenced by rmdir_test().

void seekdir DIR *  dirp,
long  loc
 

Description:
Seek directory (Std. UNIX; see AUP2 Sec. 3.6.1)
Headers:
dirent.h
Parameters:
dirp  DIR pointer from opendir
loc  location

int select int  nfds,
fd_set *  readset,
fd_set *  writeset,
fd_set *  errorset,
struct timeval timeout
 

Calls select.

Parameters:
nfds  highest fd + 1
readset  read set or NULL
writeset  write set or NULL
errorset  error set or NULL
timeout  time-out (microseconds) or NULL

Definition at line 361 of file uxfile.cpp.

References errno.

Referenced by main(), pcsync_wait_for_parent(), pt_wait_master(), readany2(), readbuf(), run_server(), ssi_wait_server(), and thread_fdset().

int sem_close sem_t sem  ) 
 

Description:
Close named semaphore (Std. UNIX; see AUP2 Sec. 7.10.1)
Headers:
semaphore.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
sem  semaphore

Referenced by SimpleSemClose().

int sem_destroy sem_t sem  ) 
 

Description:
Destroy unnamed semaphore (Std. UNIX; see AUP2 Sec. 7.10.2)
Headers:
semaphore.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
sem  semaphore

Referenced by op_semi().

int sem_getvalue sem_t *restrict  sem,
int *  valuep
 

Description:
Get value of semaphore (Std. UNIX; see AUP2 Sec. 7.10.1)
Headers:
semaphore.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
sem  semaphpre
valuep  returned value

Referenced by main().

int sem_init sem_t sem,
int  pshared,
unsigned  value
 

Description:
Initialize unnamed semaphore (Std. UNIX; see AUP2 Sec. 7.10.2)
Headers:
semaphore.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
sem  semaphore
pshared  shared between processes?
value  initial value

Referenced by smi_open_pshm().

sem_t* sem_open const char *  name,
int  flags
 

Description:
Open named semaphore (Std. UNIX; see AUP2 Sec. 7.10.1)
sem_t *sem_open(
const char *name, POSIX IPC name
int flags, flags (including O_CREAT)
mode_t perms, permissions
unsigned value initial value
);
Headers:
semaphore.h
Returns:
pointer to semaphore or SEM_FAILED on error (sets errno)
Parameters:
name  POSIX IPC name
flags  flags (excluding O_CREAT)

Referenced by main(), setup_posix_sem(), and SimpleSemOpen().

int sem_post sem_t sem  ) 
 

Description:
Increment semaphore (Std. UNIX; see AUP2 Sec. 7.10.1)
Headers:
semaphore.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
sem  semaphore

Referenced by main(), op_semi(), setup_posix_sem(), and SimpleSemPost().

int sem_timedwait sem_t *restrict  sem,
const struct timespec time
 

Description:
Decrement semaphore (Std. UNIX; see AUP2 Sec. 7.10.1)
Headers:
semaphore.h , time.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
sem  semaphore
time  absolute time

int sem_trywait sem_t sem  ) 
 

Description:
Decrement semaphore if possible (Std. UNIX; see AUP2 Sec. 7.10.1)
Headers:
semaphore.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
sem  semaphore

int sem_unlink const char *  name  ) 
 

Description:
Remove named semaphore (Std. UNIX; see AUP2 Sec. 7.10.1)
Headers:
semaphore.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
name  POSIX IPC name

Referenced by main().

int sem_wait sem_t sem  ) 
 

Description:
Decrement semaphore (Std. UNIX; see AUP2 Sec. 7.10.1)
Headers:
semaphore.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
sem  semaphore

Referenced by main(), op_semi(), and SimpleSemWait().

int semctl int  semid,
int  semnum,
int  cmd,
union semun  arg
 

Description:
Control semaphore set (Std. UNIX; see AUP2 Sec. 7.9.1)
Headers:
sys/sem.h
Returns:
value or 0 on success; -1 on error (sets errno)
Parameters:
semid  identifier
semnum  semaphore number
cmd  command
arg  argument for command

Referenced by init_semi(), setup_systemv_sem(), SimpleSemOpen(), SimpleSemRemove(), smi_close_shm(), and smi_open_shm().

int semget key_t  key,
int  nsems,
int  flags
 

Description:
Get semaphore-set identifier (Std. UNIX; see AUP2 Sec. 7.9.1)
Headers:
sys/sem.h
Returns:
identifier or -1 on error (sets errno)
Parameters:
key  key
nsems  size of set
flags  flags

Referenced by main(), setup_systemv_sem(), SimpleSemOpen(), SimpleSemRemove(), and smi_open_shm().

int semop int  semid,
struct sembuf sops,
size_t  nsops
 

Description:
Operate on semaphore set (Std. UNIX; see AUP2 Sec. 7.9.2)
Headers:
sys/sem.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
semid  identifier
sops  operations
nsops  number of operations

Referenced by op_semi(), setup_systemv_sem(), SimpleSemOpen(), SimpleSemPost(), SimpleSemWait(), and thread_svsem().

ssize_t send int  socket_fd,
const void *  data,
size_t  length,
int  flags
 

Description:
Send data to socket (Std. UNIX; see AUP2 Sec. 8.9.1)
Headers:
sys/socket.h
Returns:
number of bytes sent or -1 on error (sets errno)
Parameters:
socket_fd  socket file descriptor
data  data to send
length  length of data
flags  flags

ssize_t sendmsg int  socket_fd,
const struct msghdr message,
int  flags
 

Description:
Send a message on a socket using a message structure (Std. UNIX; see AUP2 Sec. 8.6.3)
Headers:
sys/socket.h
Returns:
number of bytes sent or -1 on error (sets errno)
Parameters:
socket_fd  socket file descriptor
message  message
flags  flags

Referenced by run_server().

ssize_t sendto int  socket_fd,
const void *  message,
size_t  length,
int  flags,
const struct sockaddr *  sa,
socklen_t  sa_len
 

Description:
Send message to socket (Std. UNIX; see AUP2 Sec. 8.6.2)
Headers:
sys/socket.h
Returns:
number of bytes sent or -1 on error (sets errno)
Parameters:
socket_fd  socket file descriptor
message  message to send
length  length of message
flags  flags
sa  target address
sa_len  length of target address

Referenced by main(), run_client(), and run_server().

int setegid gid_t  gid  ) 
 

Description:
Set effective group ID (Std. UNIX; see AUP2 Sec. 5.12)
Headers:
unistd.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
gid  effective group ID

int setenv const char *  var,
const char *  val,
int  overwrite
 

Description:
Change or add to environment (Std. UNIX; see AUP2 Sec. 5.2)
Headers:
stdlib.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
var  variable to be changed or added
val  value
overwrite  overwrite?

Definition at line 43 of file setenv.c.

References environ, errno, setnew(), and val.

int seteuid uid_t  uid  ) 
 

Description:
Set effective user ID (Std. UNIX; see AUP2 Sec. 5.12)
Headers:
unistd.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
uid  effective user ID

int setgid gid_t  gid  ) 
 

Description:
Set real, effective, and saved group ID (Std. UNIX; see AUP2 Sec. 5.12)
Headers:
unistd.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
gid  real and saved group ID

void sethostent int  stayopen  ) 
 

Description:
Start host-database scan (Std. UNIX; see AUP2 Sec. 8.8.1)
Headers:
netdb.h
Parameters:
stayopen  leave connection open?

Referenced by hostdb().

int setitimer int  which,
const struct itimerval val,
struct itimerval oval
 

Description:
Set value of interval timer (Std. UNIX; see AUP2 Sec. 9.7.4)
Headers:
sys/time.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
which  timer to set
val  value to set
oval  returned old value

int setjmp jmp_buf  loc_info  ) 
 

Description:
Set jump point (Std. UNIX; see AUP2 Sec. 9.6)
Headers:
setjmp.h
Returns:
0 if called directly, non-zero if from longjmp (no error return)
Parameters:
loc_info  saved location information

Referenced by main().

void setnetent int  stayopen  ) 
 

Description:
Start network-database scan (Std. UNIX; see AUP2 Sec. 8.8.2)
Headers:
netdb.h
Parameters:
stayopen  leave connection open?

Referenced by netdb().

int setpgid pid_t  pid,
pid_t  pgid
 

Description:
Set or create process-group (Std. UNIX; see AUP2 Sec. 4.3.3)
Headers:
unistd.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
pid  process ID or 0 for calling process
pgid  process-group ID

void setprotoent int  stayopen  ) 
 

Description:
Start protocol-database scan (Std. UNIX; see AUP2 Sec. 8.8.3)
Headers:
netdb.h
Parameters:
stayopen  leave connection open?

Referenced by main(), and protodb().

int setrlimit int  resource,
const struct rlimit rlp
 

Description:
Set resource limits (Std. UNIX; see AUP2 Sec. 5.16)
Headers:
sys/resource.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
resource  resource
rlp  limits to set

Referenced by main(), and process_test().

void setservent int  stayopen  ) 
 

Description:
Start service-database scan (Std. UNIX; see AUP2 Sec. 8.8.4)
Headers:
netdb.h
Parameters:
stayopen  leave connection open?

Referenced by servdb().

pid_t setsid void   ) 
 

Description:
Create session and process group (Std. UNIX; see AUP2 Sec. 4.3.2)
Headers:
unistd.h
Returns:
process-group ID or -1 on error (sets errno)

Referenced by pt_open_slave().

int setsockopt int  socket_fd,
int  level,
int  option,
const void *  value,
socklen_t  value_len
 

Description:
Set the socket options (Std. UNIX; see AUP2 Sec. 8.3)
Headers:
sys/socket.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
socket_fd  socket file descriptor
level  level to be accessed
option  option to set
value  value to set
value_len  length of value

Referenced by ssi_open().

int setuid uid_t  uid  ) 
 

Description:
Set real, effective, and saved user ID (Std. UNIX; see AUP2 Sec. 5.12)
Headers:
unistd.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
uid  real and saved user ID

int shm_open const char *  name,
int  flags,
mode_t  perms
 

Description:
Open shared-memory object (Std. UNIX; see AUP2 Sec. 7.14.1)
Headers:
sys/mman.h
Returns:
file descriptor or -1 on error (sets errno)
Parameters:
name  POSIX IPC name
flags  flags
perms  permissions

Referenced by get_client(), and smi_open_pshm().

int shm_unlink const char *  name  ) 
 

Description:
Remove shared-memory object (Std. UNIX; see AUP2 Sec. 7.14.1)
Headers:
sys/mman.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
name  POSIX IPC name

Referenced by smi_close_pshm(), and smi_open_pshm().

void* shmat int  shmid,
const void *  shmaddr,
int  flags
 

Description:
Attach shared memory segment (Std. UNIX; see AUP2 Sec. 7.13.1)
Headers:
sys/shm.h
Returns:
pointer or -1 on error (sets errno)
Parameters:
shmid  identifier
shmaddr  desired address or NULL
flags  attachment flags

Referenced by getaddr(), and smi_open_shm().

int shmctl int  shmid,
int  cmd,
struct shmid_ds *  data
 

Description:
Control shared memory segment (Std. UNIX; see AUP2 Sec. 7.13.1)
Headers:
sys/shm.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
shmid  identifier
cmd  command
data  data for command

Referenced by smi_close_shm(), and smi_open_shm().

int shmdt const void *  shmaddr  ) 
 

Description:
Detach shared memory segment (Std. UNIX; see AUP2 Sec. 7.13.1)
Headers:
sys/shm.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
shmaddr  pointer to segment

Referenced by getaddr(), and smi_close_shm().

int shmget key_t  key,
size_t  size,
int  flags
 

Description:
Get shared memory segment (Std. UNIX; see AUP2 Sec. 7.13.1)
Headers:
sys/shm.h
Returns:
shared-memory identifier or -1 on error (sets errno)
Parameters:
key  key
size  size of segment
flags  creation flags

Referenced by getaddr(), and smi_open_shm().

int shutdown int  socket_fd,
int  how
 

Description:
Shut down socket send and/or receive operations (Std. UNIX; see AUP2 Sec. 8.9.4)
Headers:
sys/socket.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
socket_fd  socket file descriptor
how  SHUT_RD, SHUT_WR, or SHUT_RDWR

int sigaction int  signum,
const struct sigaction act,
struct sigaction oact
 

Description:
Set signal action (Std. UNIX; see AUP2 Sec. 9.1.6)
Headers:
signal.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
signum  signal
act  new action
oact  old action

Referenced by aup_sleep(), entry_sig(), handle_signals(), ignore_sig(), main(), pcsync_wait_for_parent(), posixsem_test(), sysvsem_test(), try2(), try3(), and try4().

int sigaddset sigset_t *  set,
int  signum
 

Description:
Add signal to signal set (Std. UNIX; see AUP2 Sec. 9.1.5)
Headers:
signal.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
set  signal set
signum  signal

Referenced by aup_sleep(), handle_signals(), pcsync_init(), thread_signal(), try3(), try4(), try5(), and uem_register_signal().

int sigaltstack const stack_t *  stack,
stack_t *  ostack
 

Description:
Set and get alternate stack context (Std. UNIX; see AUP2 Sec. 9.3)
Headers:
signal.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
stack  new stack
ostack  old stack

int sigdelset sigset_t *  set,
int  signum
 

Description:
Delete a signal from a signal set (Std. UNIX; see AUP2 Sec. 9.1.5)
Headers:
signal.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
set  signal set
signum  signal

Referenced by aup_sleep(), pcsync_wait_for_parent(), try3(), try4(), and uem_bgn().

int sigemptyset sigset_t *  set  ) 
 

Description:
Initialize empty signal set (Std. UNIX; see AUP2 Sec. 9.1.5)
Headers:
signal.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
set  signal set

Referenced by aup_sleep(), handle_signals(), pcsync_init(), thread_signal(), try3(), try4(), try5(), uem_bgn(), and uem_register_signal().

int sigfillset sigset_t *  set  ) 
 

Description:
Initialize full signal set (Std. UNIX; see AUP2 Sec. 9.1.5)
Headers:
signal.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
set  signal set

Referenced by handle_signals(), main(), pcsync_wait_for_parent(), try3(), try4(), and uem_bgn().

int sighold int  signum  ) 
 

Description:
Block a signal (Std. UNIX; see AUP2 Sec. 9.4)
Headers:
signal.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
signum  signal

int sigignore int  signum  ) 
 

Description:
Ignore signal (Std. UNIX; see AUP2 Sec. 9.4)
Headers:
signal.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
signum  signal

int siginterrupt int  signum,
int  on
 

Description:
Set or clear SA_RESTART flag (Std. UNIX; see AUP2 Sec. 9.3)
Headers:
signal.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
signum  signal
on  non-zero to set, zero to clear

int sigismember const sigset_t *  set,
int  signum
 

Description:
Test for signal in signal set (Std. UNIX; see AUP2 Sec. 9.1.5)
Headers:
signal.h
Returns:
1 if member, 0 if not, or -1 on error (sets errno)
Parameters:
set  signal set
signum  signal

void siglongjmp sigjmp_buf  loc_info,
int  val
 

Description:
Jump to jump point, restore signal mask if saved (Std. UNIX; see AUP2 Sec. 9.6)
Headers:
setjmp.h
Parameters:
loc_info  saved location information
val  value for sigsetjmp to return

int sigpause int  signum  ) 
 

Description:
Change signal mask and wait for signal (Std. UNIX; see AUP2 Sec. 9.4)
Headers:
signal.h
Returns:
-1 on error, always (sets errno)
Parameters:
signum  signal

int sigpending sigset_t *  set  ) 
 

Description:
Examine pending signals (Std. UNIX; see AUP2 Sec. 9.3)
Headers:
signal.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
set  returned set of pending signals

int sigprocmask int  how,
const sigset_t *  set,
sigset_t *  oset
 

Description:
Change threadís signal mask (single thread only) (Std. UNIX; see AUP2 Sec. 9.1.5)
Headers:
signal.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
how  how signal mask is to be changed
set  input set
oset  previous signal mask

Referenced by aup_sleep(), handle_signals(), main(), pcsync_init(), pcsync_unblock_children(), pcsync_wait_for_parent(), try3(), try4(), and try5().

int sigqueue pid_t  pid,
int  signum,
const union sigval  value
 

Description:
Generate signal for process (Std. UNIX; see AUP2 Sec. 9.5.4)
Headers:
signal.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
pid  process ID
signum  signal
value  value

Referenced by main().

int sigrelse int  signum  ) 
 

Description:
Unblock signal (Std. UNIX; see AUP2 Sec. 9.4)
Headers:
signal.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
signum  signal

int sigsetjmp sigjmp_buf  loc_info,
int  savemask
 

Description:
Set jump point (Std. UNIX; see AUP2 Sec. 9.6)
Headers:
setjmp.h
Returns:
0 if called directly, non-zero if from siglongjmp (no error return)
Parameters:
loc_info  saved location information
savemask  non-zero to save signal mask

int sigsuspend const sigset_t *  sigmask  ) 
 

Description:
Change signal mask and wait for signal (Std. UNIX; see AUP2 Sec. 9.2.3)
Headers:
signal.h
Returns:
-1 on error, always (sets errno)
Parameters:
sigmask  temporary signal mask

Referenced by aup_sleep(), pcsync_wait_for_parent(), and try4().

int sigtimedwait const sigset_t *  set,
siginfo_t info,
const struct timespec ts
 

Description:
Wait for signal (Std. UNIX; see AUP2 Sec. 9.5.5)
Headers:
signal.h
Returns:
signal number or -1 on error (sets errno)
Parameters:
set  signals to wait for
info  returned info
ts  max. time to wait

int sigwait const sigset_t *  set,
int *  signum
 

Description:
Wait for signal (Std. UNIX; see AUP2 Sec. 9.2.2)
Headers:
signal.h
Returns:
0 on success or error number on error
Parameters:
set  signals to wait for
signum  signal that was delivered

Referenced by sig_thread(), thread_signal(), and try5().

int sigwaitinfo const sigset_t *  set,
siginfo_t info
 

Description:
Wait for signal (Std. UNIX; see AUP2 Sec. 9.5.5)
Headers:
signal.h
Returns:
signal number or -1 on error (sets errno)
Parameters:
set  signals to wait for
info  returned info

unsigned sleep unsigned  secs  ) 
 

Description:
Suspend execution for seconds or until signal (Std. UNIX; see AUP2 Sec. 9.7.2)
Headers:
unistd.h
Returns:
unslept amount
Parameters:
secs  seconds to sleep

Referenced by ev_sleep(), file_ctime_test(), lock(), main(), playback(), process(), process_test(), readany(), run_client(), setup_fdset(), setup_posix_msg(), setup_posix_sem(), setup_process(), setup_signal(), setup_systemv_msg(), setup_systemv_sem(), SimpleSemOpen(), Ux::Clock::sleep(), smi_open_shm(), sorter(), test_setblock(), testlock(), thread1_func(), and thread_func().

int sockatmark int  socket_fd  ) 
 

Description:
Test presence of out-of-band mark (Std. UNIX; see AUP2 Sec. 8.7)
Headers:
sys/socket.h
Returns:
1 if at mark, 0 if not, or -1 on error (sets errno)
Parameters:
socket_fd  socket file descriptor

int socket int  domain,
int  type,
int  protocol
 

Description:
Create endpoint for communication (Std. UNIX; see AUP2 Sec. 8.1.2)
Headers:
sys/socket.h
Returns:
file descriptor or -1 on error (sets errno)
Parameters:
domain  domain (AF_UNIX, AF_INET, etc.)
type  SOCK_STREAM, SOCK_DGRAM, etc.
protocol  specific to type; usually zero

Referenced by main(), main1(), run_client(), run_server(), and ssi_open().

int socketpair int  domain,
int  type,
int protocol int  socket_vector[2]
 

Description:
Create pair of sockets (Std. UNIX; see AUP2 Sec. 8.9.3)
Headers:
sys/socket.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
domain  domain (AF_UNIX, AF_INET, etc.)
type  SOCK_STREAM, SOCK_DGRAM, etc.
socket_vector  specific to type; usually zero returned socket file descriptors

int stat const char *  path,
struct stat buf
 

Description:
Get file info by path (Std. UNIX; see AUP2 Sec. 3.5.1)
Headers:
sys/stat.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
path  pathname
buf  returned information

Referenced by handle_request(), and main().

int statvfs const char *path struct statvfs buf  ) 
 

Description:
Get file system information by path (Std. UNIX; see AUP2 Sec. 3.2.3)
Headers:
sys/statvfs.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
buf  pathname returned info

size_t strftime char *  buf,
size_t  bufsize,
const char *  format,
const struct tm tmbuf
 

Description:
Convert broken-down time to string with format (Std. UNIX; see AUP2 Sec. 1.7.1)
Headers:
time.h
Returns:
byte count or 0 on error (errno not set)
Parameters:
buf  output buffer
bufsize  size of buffer
format  format
tmbuf  broken-down time

Referenced by logfmt(), and print_date().

char* strptime const char *  s,
const char *  format,
struct tm tmbuf
 

Description:
Convert string to broken-down time with format (Std. UNIX; see AUP2 Sec. 1.7.1)
Headers:
time.h
Returns:
? or NULL on error (errno not set)
Parameters:
s  string to convert
format  format
tmbuf  broken-down time (output)

int symlink const char *  oldpath,
const char *  newpath
 

Description:
Create a symbolic link (Std. UNIX; see AUP2 Sec. 3.3.3)
Headers:
unistd.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
oldpath  old pathname
newpath  possible new pathname

Referenced by main().

void sync void   ) 
 

Description:
Schedule buffer-cache flushing (Std. UNIX; see AUP2 Sec. 2.16.2)
Headers:
unistd.h

Referenced by main().

long sysconf int  name  ) 
 

Description:
Get system option or limit (Std. UNIX; see AUP2 Sec. 1.5.5)
Headers:
unistd.h
Returns:
option/limit value or -1 (sets errno on error)
Parameters:
name  option or limit name

Referenced by junk(), main(), and timestart().

int system const char *  command  ) 
 

Description:
Run command (Std. UNIX; see AUP2 Sec. 5.5)
Headers:
stdlib.h
Returns:
exit status or -1 on error (sets errno)
Parameters:
command  command

Referenced by ftruncate_test(), junk(), main(), pwrite_test(), readdir_test(), rmdir_test(), and runtest().

int tcdrain int  fd  ) 
 

Description:
Drain (wait for) terminal output (Std. UNIX; see AUP2 Sec. 4.6)
Headers:
termios.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
fd  file descriptor

Referenced by playback().

int tcflow int  fd,
int  action
 

Description:
Suspend or restart flow of terminal input or output (Std. UNIX; see AUP2 Sec. 4.6)
Headers:
termios.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
fd  file descriptor
action  direction and suspend/restart

int tcflush int  fd,
int  queue
 

Description:
Flush (throw away) terminal output, input, or both (Std. UNIX; see AUP2 Sec. 4.6)
Headers:
termios.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
fd  file descriptor
queue  queue to be affected

int tcgetattr int  fd,
struct termios tp
 

Description:
Get terminal attributes (Std. UNIX; see AUP2 Sec. 4.5.1)
Headers:
termios.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
fd  file descriptor
tp  attributes

Referenced by playback(), tc_keystroke(), and tc_setraw().

pid_t tcgetpgrp int  fd  ) 
 

Description:
Get foreground process-group ID (Std. UNIX; see AUP2 Sec. 4.3.4)
Headers:
unistd.h
Returns:
process-group ID or -1 on error (sets errno)
Parameters:
fd  file descriptor

Referenced by showpginfo().

pid_t tcgetsid int  fd  ) 
 

Description:
Get session ID (Std. UNIX; see AUP2 Sec. 4.3.4)
Headers:
termios.h
Returns:
session ID or -1 on error (sets errno)
Parameters:
fd  file descriptor

Referenced by showpginfo().

int tcsendbreak int  fd,
int  duration
 

Description:
Send break to terminal (Std. UNIX; see AUP2 Sec. 4.6)
Headers:
termios.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
fd  file descriptor
duration  duration of break

int tcsetattr int  fd,
int  actions,
const struct termios tp
 

Description:
Set terminal attributes (Std. UNIX; see AUP2 Sec. 4.5.1)
Headers:
termios.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
fd  file descriptor
actions  actions on setting
tp  attributes

Referenced by playback(), tc_keystroke(), tc_restore(), and tc_setraw().

int tcsetpgrp int  fd,
pid_t  pgid
 

Description:
Set foreground process-group ID (Std. UNIX; see AUP2 Sec. 4.3.4)
Headers:
unistd.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
fd  file descriptor
pgid  process-group ID

long telldir DIR *  dirp  ) 
 

Description:
Get directory location (Std. UNIX; see AUP2 Sec. 3.6.1)
Headers:
dirent.h
Returns:
location (no error return)
Parameters:
dirp  DIR pointer from opendir

Referenced by Ux::DirStream::tell().

time_t time time_t *  t  ) 
 

Description:
Get current date and time as time_t (Std. UNIX; see AUP2 Sec. 1.7.1)
Headers:
time.h
Returns:
time or -1 on error (errno not set)
Parameters:
t  NULL or returned time

Referenced by Ux::Timestr::ctime(), getaddr(), Ux::Timetm::gmtime(), Ux::Timetm::localtime(), logfmt(), main(), print_date(), send_header_OK(), test_setblock(), and Ux::PosixSem::timedwait().

int timer_create clockid_t  clockid,
struct sigevent sig,
timer_t *  timer_id
 

Description:
Create per-process timer (Std. UNIX; see AUP2 Sec. 9.7.6)
Headers:
signal.h , time.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
clockid  clock ID
sig  NULL or signal to generate
timer_id  returned timer ID

int timer_delete timer_t  timer_id  ) 
 

Description:
Delete per-process timer (Std. UNIX; see AUP2 Sec. 9.7.6)
Headers:
time.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
timer_id  timer ID

int timer_getoverrun timer_t  timer_id  ) 
 

Description:
Get per-process timer overrun count (Std. UNIX; see AUP2 Sec. 9.7.6)
Headers:
time.h
Returns:
overrun count or -1 on error (sets errno)
Parameters:
timer_id  timer ID

int timer_gettime timer_t  timer_id,
struct itimerspec val
 

Description:
Get value of per-process timer (Std. UNIX; see AUP2 Sec. 9.7.6)
Headers:
time.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
timer_id  timer ID
val  returned value

int timer_settime timer_t  timer_id,
int  flags,
const struct itimerspec val,
struct itimerspec oval
 

Description:
Set value of per-process timer (Std. UNIX; see AUP2 Sec. 9.7.6)
Headers:
time.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
timer_id  timer ID
flags  flags
val  value to set
oval  returned old value

clock_t times struct tms buffer  ) 
 

Description:
Get process and child-process execution times (Std. UNIX; see AUP2 Sec. 1.7.2)
Headers:
sys/times.h
Returns:
time in clock ticks or -1 on error (sets errno)

Referenced by timestart(), and timestop().

int truncate const char *  path,
off_t  length
 

Description:
Truncate or stretch file by path (Std. UNIX; see AUP2 Sec. 2.17)
Headers:
unistd.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
path  pathname
length  new length

char* ttyname int  fd  ) 
 

Description:
Find pathname of terminal (Std. UNIX; see AUP2 Sec. 4.7)
Headers:
unistd.h
Returns:
string or NULL on error (sets errno)
Parameters:
fd  file descriptor

Referenced by main().

int ttyname_r int  fd,
char *  buf,
size_t  bufsize
 

Description:
Find pathname of terminal (Std. UNIX; see AUP2 Sec. 4.7)
Headers:
unistd.h
Returns:
0 on success or error number on error (sets errno)
Parameters:
fd  file descriptor
buf  buffer for pathname
bufsize  size of buffer

void tzset void   ) 
 

long ulimit int  cmd,
... 
 

Description:
Get and set process limits (Std. UNIX; see AUP2 Sec. 5.16)
Headers:
ulimit.h
Returns:
limit or -1 with errno changed on error (sets errno)
Parameters:
cmd  command

mode_t umask mode_t  cmask  ) 
 

Description:
Set and get file mode creation mask (Std. UNIX; see AUP2 Sec. 2.5)
Headers:
sys/stat.h
Returns:
previous mask (no error return)
Parameters:
cmask  new mask

Referenced by Ux::Process::umask().

int umount const char *  target  ) 
 

Description:
Unmount file system (non-standard) (Std. UNIX; see AUP2 Sec. 3.2.4)
Headers:
sys/mount.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
target  directory

int uname struct utsname *  name  ) 
 

Description:
Get the name of the current system (Std. UNIX; see AUP2 Sec. 8.8.1)
Headers:
sys/utsname.h
Returns:
? or -1 on error (sets errno)

Referenced by main().

int unlink const char *  path  ) 
 

Description:
Remove directory entry (Std. UNIX; see AUP2 Sec. 2.6)
Headers:
unistd.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
path  pathname

Referenced by backward_test(), cleanup_previous_run(), fcntl_example(), junk(), main(), run_client(), SimpleSemRemove(), smi_close_fifo(), smi_close_shm(), smi_open_fifo(), ssi_close(), ssi_open(), and unlock().

int unlockpt int  fd  ) 
 

Description:
Unlock pty (Std. UNIX; see AUP2 Sec. 4.10.1)
Headers:
stdlib.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
fd  file descriptor

Referenced by pt_open_master().

int unsetenv const char *  var  ) 
 

Description:
Remove environment variable (Std. UNIX; see AUP2 Sec. 5.2)
Headers:
stdlib.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
var  variable to be removed

Definition at line 80 of file setenv.c.

References environ, and errno.

int usleep useconds_t  usecs  ) 
 

Description:
Suspend execution for microseconds or until signal (Std. UNIX; see AUP2 Sec. 9.7.3)
Headers:
unistd.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
usecs  microseconds to sleep

Referenced by ev_sleep(), process_test(), and store().

int utime const char *  path,
const struct utimbuf timbuf
 

Description:
Set file access and modification times (Std. UNIX; see AUP2 Sec. 3.7.3)
Headers:
utime.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
path  pathname
timbuf  new times

pid_t vfork void   ) 
 

Description:
Create new process; share memory (obsolete) (Std. UNIX; see AUP2 Sec. 5.5)
Headers:
unistd.h
Returns:
childís process-ID and 0 on success or -1 on error (sets errno)

pid_t wait int *  statusp  ) 
 

Description:
Wait for child process to terminate (Std. UNIX; see AUP2 Sec. 5.8)
Headers:
sys/wait.h
Returns:
process ID or -1 on error (sets errno)
Parameters:
statusp  pointer to status or NULL

Referenced by main().

int waitid idtype_t  idtype,
id_t  id,
siginfo_t infop,
int  options
 

Description:
Wait for child process to change state [X/Open] (Std. UNIX; see AUP2 Sec. 5.8)
Headers:
sys/wait.h
Returns:
0 on success or -1 on error (sets errno)
Parameters:
idtype  interpretation of id
id  process or process-group ID
infop  returned info
options  options

pid_t waitpid pid_t  pid,
int *  statusp,
int  options
 

Description:
Wait for child process to change state (Std. UNIX; see AUP2 Sec. 5.8)
Headers:
sys/wait.h
Returns:
process ID or 0 on success or -1 on error (sets errno)
Parameters:
pid  process or process-group ID
statusp  pointer to status or NULL
options  options (see below)

Referenced by execute3(), fsort(), fsort0(), main(), pipewrite2(), pipewrite2bug(), thread_process(), Ux::Process::wait(), wait_and_display(), Ux::Process::waitpid(), who_wc(), and who_wc2().

size_t wcsftime wchar_t *  buf,
size_t  bufsize,
const wchar_t *  format,
const struct tm tmbuf
 

Description:
Convert broken-down time to wide-character string with format (Std. UNIX; see AUP2 Sec. 1.7.1)
Headers:
wchar.h
Returns:
wchar_t count or zero on error (errno not set)
Parameters:
buf  output buffer
bufsize  size of buffer
format  format
tmbuf  broken-down time

ssize_t write int  fd,
const void *  buf,
size_t  nbytes
 

Description:
Write to file descriptor (Std. UNIX; see AUP2 Sec. 2.9)
Headers:
unistd.h
Returns:
number of bytes written or -1 on error (sets errno)
Parameters:
fd  file descriptor
buf  data to write
nbytes  amount to write

Referenced by alarm_handler(), buildfile(), copy(), copy2(), copy2a(), fcn(), file_ctime_test(), fsort(), fsort0(), ftruncate_test(), handler(), junk(), main(), main1(), pcsync_unblock_children(), pcsync_wait_for_parent(), pipetest(), pipewrite(), pipewrite2(), pipewrite2bug(), playback(), pwrite_test(), run_client(), run_server(), setup_fdset(), smi_send_release_fifo(), synctest(), time_traffic(), writeall(), and writebuf().

ssize_t writev int  fd,
const struct iovec iov,
int  iovcnt
 

Description:
Gather write (Std. UNIX; see AUP2 Sec. 2.15)
Headers:
sys/uio.h
Returns:
number of bytes written or -1 on error (sets errno)
Parameters:
fd  file descriptor
iov  vector of data buffers
iovcnt  number of elements

Referenced by main(), and scatter().


Variable Documentation

int daylight
 

DST? (not in FreeBSD)

Definition at line 3957 of file SUS_Summary.

void(*)(int) signal( int signum, void (*act)(int) )
 

Description:
Set signal action (Std. UNIX; see AUP2 Sec. 9.4)
Headers:
signal.h
Returns:
old action or SIG_ERR on error (sets errno)

Definition at line 2944 of file SUS_Summary.

Referenced by setup_fdset().

void(*)(int) sigset( int signum, void (*act)(int) )
 

Description:
Signal management (Std. UNIX; see AUP2 Sec. 9.4)
Headers:
signal.h
Returns:
old action or SIG_ERR on error (sets errno)

Definition at line 3015 of file SUS_Summary.

long timezone
 

timezone in secs (not in FreeBSD)

Definition at line 3958 of file SUS_Summary.

char* tzname[2]
 

timezone strings (not in FreeBSD)

Definition at line 3959 of file SUS_Summary.


Generated on Fri Apr 23 10:57:12 2004 for AUP2 Example Source by doxygen 1.3.1