HP-UX Reference Section 2: System Calls HP-UX 11i Version 1, September 2005 Update Volume 5 of 10 Manufacturing Part Number : B2355-90906 Printed In USA E0905 Printed in USA © Copyright 1983-2005 Hewlett-Packard Development Company LP.
Legal Notices The information in this document is subject to change without notice. Warranty The only warranties for HP products and services are set forth in the express warranty statements accompanying such products and services. Nothing herein should be construed as constituting an additional warranty. HP shall not be liable for technical or editorial errors or omissions contained herein. U.S. Government License Confidential computer software.
Copyright 1996 Morning Star Technologies, Inc. Copyright 1996 Progressive Systems, Inc. Trademark Notices Intel and Itanium are registered trademarks of Intel Corporation in the US and other countries and are used under license. Java is a US trademark of Sun Microsystems, Inc. Microsoft and MS-DOS are U.S. registered trademarks of Microsoft Corporation. OSF/Motif is a trademark of The Open Group in the US and other countries. UNIX is a registered trademark of The Open Group.
Revision History This document’s printing date and part number indicate its edition. The printing date changes when a new edition is printed. (Minor corrections and updates which are incorporated at reprint do not cause the date to change.) New editions of this manual incorporate all material updated since the previous edition. Part Number Release; Date; Format; Distribution B2355-60127 HP-UX 11i Version 1; September 2005 Update; one volume HTML; http://docs.hp.com and Instant Information.
Typographical Conventions audit (5) An HP-UX manpage. audit is the name and 5 is the section in the HP-UX Reference. On the web and on the Instant Information CD, it may be a hot link to the manpage itself. From the HP-UX command line, you can enter “man audit” or “man 5 audit” to view the manpage. See man (1). Book Title The title of a book. On the web and on the Instant Information CD, it may be a hot link to the book itself. KeyCap The name of a keyboard key.
vi
Preface HP-UX is the Hewlett-Packard Company’s implementation of a UNIX operating system that is compatible with various industry standards. It is based on the System V Release 4 operating system and includes important features from the Fourth Berkeley Software Distribution. The ten volumes of this manual contain the system reference documentation, made up of individual entries called manpages, named for the man command (see man (1)) that displays them on the system.
viii
Volume Five Table of Contents Section 2
Volume Five Table of Contents Section 2
Table of Contents Volume Five Section 2: System Calls Entry Name(Section): name Description intro(2): intro ...................................................................................................... introduction to system calls __pset_rtctl(2): __pset_rtctl() ..................................................................... real-time processor set control _exit(): terminate process .............................................................................................................
Table of Contents Volume Five Entry Name(Section): name Description fdatasync(): synchronize a file’s in-core state with its state on disk ............................................ see fsync(2) fgetacl(): get access control list (ACL) information ...................................................................... see getacl(2) fork(2): fork() ................................................................................................................
Table of Contents Volume Five Entry Name(Section): name Description ............................................................................................ 4.2 BSD-compatible process control facilities link(2): link() .............................................................................................................................. link to a file lio_listio(2): lio_listio() ..............................................................
Table of Contents Volume Five Entry Name(Section): name Description PRI_POSIX_TO_HPUX(): return HP-UX process priority ........................................................... see rtsched(2) profil(2): profil() ........................................................................................................ execution time profile pset_assign(2): pset_assign() ................................................................... change processor set assignment pset_bind(2): pset_bind() ..............
Table of Contents Volume Five Entry Name(Section): name Description rtprio(2): rtprio() ...................................................................................... change or read real-time priority rtsched(2): sched_get_priority_max(), sched_get_priority_min(), sched_getparam(), sched_getscheduler(), sched_rr_get_interval(), sched_setparam(), sched_setscheduler(), sched_yield(), PRI_HPUX_TO_POSIX(), PRI_POSIX_TO_HPUX() ..................................
Table of Contents Volume Five Entry Name(Section): name Description setuname(2): set node name (system name) .............................................................................. see uname(2) shm_open(2): shm_open() ...................................................................... create/open a shared memory object shm_unlink(2): shm_unlink() ....................................................................... unlink a shared memory object shmat(): attach shared memory to data segment .....
Table of Contents Volume Five Entry Name(Section): name Description ttrace(2): ttrace() .......................................................................... tracing facility for multithreaded process ttrace_wait(2): ttrace_wait() ............................................................................ wait for ttrace() request tuneinfo(2): tuneinfo() .............................................. retrieve information about kernel tunable parameters ualarm(2): ualarm() .............................
Notes xvi Hewlett-Packard Company HP-UX 11i Version 1: September 2005
Section 2 System Calls
Section 2 System Calls
intro(2) intro(2) NAME intro - introduction to system calls DESCRIPTION This section describes all of the system calls. All of these calls return a function result. This result indicates the status of the call. Typically, a zero or positive result indicates that the call completed successfully, and −1 indicates an error. The individual descriptions specify the details. An error number is also made available in the external variable errno (see errno(2)). WARNINGS errno is not cleared on successful calls.
__pset_rtctl(2) __pset_rtctl(2) NAME __pset_rtctl() - real-time processor set control SYNOPSIS _ #include int __pset_rtctl( pset_rt_req_t request, psetid_t pset, int arg, ); DESCRIPTION HP-UX Processor Sets allow a subset of processors in the system to be isolated for exclusive use by specified threads and processes. Only the threads bound to a processor set can execute on processors in that processor set (see pset_create (2)).
__pset_rtctl(2) __pset_rtctl(2) argument is ignored. Typically, RTE_PSET_GETFIRSTPSET is called to determine the first RTE processor set. RTE_PSET_GETNEXTPSET is then called in a loop (until the call returns -1) to determine the IDs of the remaining RTE processor sets in the system. See pset_ctl(2) for additional processor set query operations. The pset_ctl() function allows users query all processor sets in the system, processors in a specific processor set, processor set given a processor, etc.
__pset_rtctl(2) __pset_rtctl(2) Processor Set Support Use sysconf() with _SC_PSET_SUPPORT to see if the processor set functionality is supported by the underlying HP-UX operating system version. _ Use sysconf() with _SC_PSET_RTE_SUPPORT to see if the RTE processor set functionality is supported by the underlying HP-UX operating system version. EXAMPLE Create a new processor set, and configure it as RTE processor set: #include
accept(2) accept(2) NAME accept - accept a connection on a socket SYNOPSIS #include a AF_CCITT only #include int accept(int s, void *addr, int *addrlen); _XOPEN_SOURCE_EXTENDED only (UNIX 98) int accept(int s, struct sockaddr *addr, socklen_t *addrlen); Obsolescent _XOPEN_SOURCE_EXTENDED only (UNIX 95) int accept(int s, struct sockaddr *addr, size_t *addrlen); DESCRIPTION The accept() system call is used with connection-based socket types, such as SOCK_STREAM .
accept(2) accept(2) If an error occurs, accept() returns -1 and sets errno to indicate the cause. ERRORS If accept() fails, errno is set to one of the following values: a [EAGAIN] Nonblocking I/O is enabled using O_NONBLOCK and no connections are present to be accepted. [EBADF] The argument, s, is not a valid file descriptor. [ECONNABORTED] The socket is being shutdown due to a request by software. This is usually caused by a shutdown() system call.
access(2) access(2) NAME access - determine accessibility of a file SYNOPSIS #include int access(char *path, int amode); a DESCRIPTION The access() system call checks the file pointed to by path for accessibility according to the bit pattern contained in amode. access() uses the real user ID, not the effective user ID, and the real group ID, not the effective group ID. The value of amode is either the bit-wise inclusive OR of the access permissions to be checked, or the existence test.
access(2) a access(2) [EFAULT] path points outside the allocated address space for the process. The reliable detection of this error is implementation dependent. [ELOOP] Too many symbolic links were encountered in translating the path name. [ENAMETOOLONG] The length of the specified path name exceeds PATH_MAX bytes, or the length of a component of the path name exceeds NAME_MAX bytes while _POSIX_NO_TRUNC is in effect.
acct(2) acct(2) NAME acct() - enable or disable process accounting SYNOPSIS #include int acct(const char *path); a DESCRIPTION The acct() system call enables or disables the system’s process accounting routine. If the routine is enabled, an accounting record is written on an accounting file for each process that terminates. Termination can be caused by one of two things: an exit() call or a signal (see exit(2) and signal(5)).
acl(2) acl(2) NAME acl() - set a file’s Access Control List (ACL) information (JFS File Systems only) SYNOPSIS a #include #include int acl(char *pathp, int cmd, int nentries, struct acl *aclbufp); DESCRIPTION The acl() system call is used to manipulate ACLs on JFS file system objects. pathp points to a pathname naming a file. nentries specifies how many ACL entries are pointed to by aclbufp. aclbufp is a pointer to the first element of an array of struct
acl(2) acl(2) If pathp points to a directory, there is at most one entry each of type DEF_USER_OBJ , DEF_GROUP_OBJ , DEF_CLASS_OBJ, and DEF_OTHER_OBJ. Entries of type USER , GROUP , DEF_USER , or DEF_GROUP do not contain duplicate entries. A duplicate entry is one of the same type containing the same numeric ID. If the ACL contains no entries of type USER and no entries of type GROUP , then the entries of type GROUP_OBJ and CLASS_OBJ have the same permissions.
adjtime(2) adjtime(2) NAME adjtime() - correct the time to synchronize the system clock SYNOPSIS a #include int adjtime( const struct timeval *delta, struct timeval *olddelta ); DESCRIPTION The function adjtime() adjusts the current time of the system. The time is either advanced or retarded by the amount of time specified in the struct timeval pointed to by delta. The adjustment is made by applying small correctional adjustments to the value of current time that the system keeps.
adjtime(2) adjtime(2) [EFAULT] The address specified for delta (or olddelta) is invalid. [EINVAL] If delta.tv_sec is greater than 31536000 (approx. 365 days) or less than −31536000. The delta.tv_usec field is not used in calculation of these limits. If the user wants to adjust time greater than these limits, an appropriate alternative interface should be used. EXAMPLES The following code snippet will take the time forward 20 minutes. struct timeval forward; forward.
aio_cancel(2) aio_cancel(2) NAME aio_cancel() - cancel an asynchronous I/O operation SYNOPSIS a #include int aio_cancel(int fildes, struct aiocb *aiocbp); DESCRIPTION The aio_cancel() function attempts to cancel the asynchronous I/O request currently outstanding for the aiocb referenced by aiocbp or, if aiocbp is NULL , any asynchronous I/O operations currently outstanding for the file descriptor fildes.
aio_error(2) aio_error(2) NAME aio_error() - return error status of an asynchronous I/O operation SYNOPSIS #include int aio_error(const struct aiocb *aiocbp); a DESCRIPTION The aio_error() function returns the error status of the asynchronous I/O operation that was initiated with the aiocb and referenced by aiocbp . The error status for an asynchronous I/O operation is the errno value set by the corresponding read() , write() , or fsync() function.
aio_fsync(2) aio_fsync(2) NAME aio_fsync() - force outstanding asynchronous operations on a file to the synchronized state SYNOPSIS a #include int aio_fsync(int op, struct aiocb *aiocbp); DESCRIPTION The aio_fsync() function asynchronously forces all I/O operations that are enqueued at the time of the call for the file or device referenced by aiocbp->aio_fildes to the synchronized I/O state.
aio_fsync(2) aio_fsync(2) STANDARDS CONFORMANCE aio_fsync() : POSIX Realtime Extensions, IEEE Std 1003.
aio_read(2) aio_read(2) NAME aio_read() - start an asynchronous read operation SYNOPSIS a #include int aio_read(struct aiocb *aiocbp); DESCRIPTION The aio_read() function allows the calling process to perform an asynchronous read from a previously opened file. The function call returns when the read operation has been enqueued for processing. At this point, processing of the read operation may proceed concurrently with execution of the calling process or thread.
aio_read(2) [EEXIST] aio_read(2) The aiocbp is already in use for another asynchronous I/O operation. Once the read request has been enqueued by aio_read() , the following errors, in addition to all of the errors normally reported by the read() function, may be reported asynchronously by a subsequent call to aio_error() or aio_return() referencing its aiocb . [EBADF] The aiocbp->aio_fildes was not a valid file descriptor open for reading. [EINVAL] The value of aiocbp->aio_reqprio is not valid.
aio_return(2) aio_return(2) NAME aio_return() - return status of an asynchronous I/O operation SYNOPSIS a #include ssize_t aio_return(struct aiocb *aiocbp); DESCRIPTION The aio_return() function returns the return status associated with the aiocb structure referenced by the aiocbp argument. The return value for an asynchronous I/O operation is the value that would be set by the corresponding read() , write() , or fsync() operation.
aio_suspend(2) aio_suspend(2) NAME aio_suspend() - wait for an asynchronous I/O operation to complete SYNOPSIS #include
aio_write(2) aio_write(2) NAME aio_write() - start asynchronous write operation SYNOPSIS a #include int aio_write(struct aiocb *aiocbp); DESCRIPTION The aio_write() function allows the calling process to perform an asynchronous write to a previously opened file. The function call returns when the write operation has been enqueued for processing. At this point, processing of the write operation may proceed concurrently with execution of the calling process or thread.
aio_write(2) aio_write(2) [EBADF] The aiocbp->aio_fildes was not a valid file descriptor open for writing. [EINVAL] The aiocb->aio_sigevent is not a valid address in the process virtual address space. [EINVAL] The parameters of the indicated sigevent in aiocb->aio_sigevent are invalid. [EINVAL] The value of aiocbp->aio_reqprio is not valid. [EINVAL] The value of aiocbp->aio_nbytes is invalid.
alarm(2) alarm(2) NAME alarm - set a process’s alarm clock SYNOPSIS a #include unsigned int alarm(unsigned int sec); DESCRIPTION alarm() instructs the alarm clock of the calling process to send the signal SIGALRM to the calling process after the number of real-time seconds specified by sec have elapsed; see signal(5). Specific implementations might place limitations on the maximum supported alarm time. The constant MAX_ALARM defined in
audctl(2) audctl(2) NAME audctl - start or halt the auditing system and set or get audit files SYNOPSIS #include int audctl(int cmd, char *cpath, char *npath, mode_t mode); a DESCRIPTION audctl() sets or gets the auditing system "current" and "next" audit files, and starts or halts the auditing system. This call is restricted to superusers. cpath and npath hold the absolute path names of the "current" and "next" files. mode specifies the audit file’s permission bits.
audctl(2) audctl(2) The caller issues the AUD_OFF command to halt the auditing system. If the auditing system is on, it is turned off and the "current" and "next" audit files are closed. cpath, npath, and mode are ignored. If the audit system is already off, -1 is returned and errno is set to [EALREADY]. AUD_OFF a RETURN VALUE Upon successful completion, a value of 0 is returned. Otherwise, -1 is returned and the global variable errno is set to indicate the error.
audswitch(2) audswitch(2) NAME audswitch - suspend or resume auditing on the current process SYNOPSIS #include int audswitch(int aflag); a DESCRIPTION audswitch() suspends or resumes auditing within the current process. This call is restricted to superusers. One of the following aflags must be used: AUD_SUSPEND Suspend auditing on the current process. AUD_RESUME Resume auditing on the current process.
audwrite(2) audwrite(2) NAME audwrite - write an audit record for a self-auditing process SYNOPSIS a #include int audwrite(const struct self_audit_rec *audrec_p); DESCRIPTION audwrite() is called by trusted self-auditing processes, which are capable of turning off the regular auditing (using audswitch(2)) and doing higher-level auditing on their own. audwrite() is restricted to superusers.
bind(2) bind(2) NAME bind - bind an address to a socket SYNOPSIS #include AF_CCITT only b #include AF_INET, AF_INET6 and AF_VME_LINK only #include AF_UNIX only #include
bind(2) bind(2) [EBADF] s is not a valid file descriptor. [EDESTADDRREQ] No addr parameter was specified. [EFAULT] addr is not a valid pointer. [EINVAL] The socket is already bound to an address, the socket has been shut down, addrlen is a bad value, or an attempt was made to bind() an AF_UNIX socket to an NFS-mounted (remote) name. b AF_CCITT: The protocol-ID length is negative or greater than 8, the X.121 address string contains an illegal character, or the X.
brk(2) brk(2) NAME brk, sbrk - change data segment space allocation SYNOPSIS #include int brk(const void *endds); void *sbrk(int incr); b DESCRIPTION brk() and sbrk() are used to change dynamically the amount of space allocated for the calling process’s data segment; see exec(2). The change is made by resetting the process’s break value and allocating the appropriate amount of space. The break value is the address of the first location beyond the end of the data segment.
chdir(2) chdir(2) NAME chdir, fchdir - change working directory SYNOPSIS #include int chdir(const char *path); int fchdir(int fildes); c DESCRIPTION chdir() and fchdir() cause a directory pointed to by path or fildes to become the current working directory, the starting point for path searches of path names not beginning with /. path points to the path name of a directory. fildes is an open file descriptor of a directory.
chmod(2) chmod(2) NAME chmod(), fchmod() - change file mode access permissions SYNOPSIS #include int chmod(const char *path, mode_t mode); int fchmod(int fildes, mode_t mode); DESCRIPTION The chmod() and fchmod() system calls set the access permission portion of the file’s mode according to the bit pattern contained in mode. path points to a path name naming a file. fildes is a file descriptor.
chmod(2) chmod(2) Access Control Lists - JFS File Systems Only The effective permissions granted by optional entries in a file’s access control list may be changed when chmod() is executed. In particular, using chmod() to remove read, write and execute permissions from a file’s owner, owning group, and all others works as expected, because chmod() affects the class entry in the ACL, limiting any access that can be granted to additional users or groups via optional ACL entries.
chown(2) chown(2) NAME chown(), fchown(), lchown() - change owner and group of a file SYNOPSIS #include int chown(const char *path, uid_t owner, gid_t group); int lchown(const char *path, uid_t owner, gid_t group); int fchown(int fildes, uid_t owner, gid_t group); c DESCRIPTION The chown() system call changes the user and group ownership of a file. path points to the path name of a file.
chown(2) c chown(2) [EACCES] Search permission is denied on a component of the path prefix. [EBADF] fildes is not a valid file descriptor. [EFAULT] path points outside the allocated address space of the process. The reliable detection of this error is implementation dependent. [EINVAL] Either owner or group is greater than or equal to UID_MAX , or is an illegal negative value. [ELOOP] Too many symbolic links were encountered in translating path.
chroot(2) chroot(2) (TO BE OBSOLETED) NAME chroot - change root directory SYNOPSIS #include int chroot(const char *path); DESCRIPTION chroot() causes the named directory to become the root directory, the starting point for path searches for path names beginning with /. path points to a path name naming a directory. The user’s working directory is unaffected by the chroot() system call.
clocks(2) clocks(2) NAME clock_settime(), clock_gettime(), clock_getres() - clock operations SYNOPSIS c #include int clock_settime( clockid_t clock_id, const struct timespec *tp ); int clock_gettime( clockid_t clock_id, struct timespec *tp ); int clock_getres( clockid_t clock_id, struct timespec *res ); DESCRIPTION clock_settime() The clock_settime() function sets the specified clock, clock_id , to the value specified by tp .
clocks(2) clocks(2) ERRORS If any of the following conditions occur, the clock_settime(), clock_gettime(), and clock_getres() functions return −1 and set errno (see errno(2)) to the corresponding value: [ENOSYS] The functions clock_settime(), clock_gettime(), and clock_getres() are not supported by this implementation. [EINVAL] The clock_id argument does not specify a known clock. [EINVAL] The tp argument to clock_settime() is outside the range for the given clock_id .
close(2) close(2) NAME close - close a file descriptor SYNOPSIS #include int close(int fildes); c DESCRIPTION close() closes the file descriptor indicated by fildes. fildes is a file descriptor obtained from a creat() , open() , dup() , fcntl() , or pipe() system call. All associated file segments which have been locked by this process with the lockf() function are released (i.e., unlocked).
connect(2) connect(2) NAME connect - initiate a connection on a socket SYNOPSIS #include AF_CCITT only #include c AF_INET, AF_INET6 and AF_VME_LINK only #include AF_UNIX only #include
connect(2) connect(2) AF_CCITT Only Use the x25addrstr struct for the address structure. The caller must know the X.121 address of the DTE to which the connection is to be established, including any subaddresses or protocol IDs that may be needed. If address-matching by protocol ID, specify the protocol ID with the X25_WR_USER_DATA ioctl() call before issuing the connect() call. c DEPENDENCIES AF_CCITT The SO_REUSEADDR option to setsockopt() is not supported for sockets in the AF_CCITT address family.
connect(2) [ENETUNREACH] connect(2) The network is not reachable from this host. For AF_CCITT only: X.25 Level 2 is down. The X.25 link is not working: wires might be broken, connections are loose on the interface hoods at the modem, the modem failed, or noise interfered with the line for an extremely long period of time. [ENOBUFS] No buffer space is available. The connect() has failed. [ENOMEM] No memory is available. The connect() has failed.
crashconf(2) crashconf(2) NAME crashconf() - configure system crash dumps SYNOPSIS c #include int crashconf( int operation, int includeClasses, int excludeClasses, int deviceCount, char **devices, int *deviceReturn ); DESCRIPTION crashconf() changes the current system crash dump configuration. The crash dump configuration consists of: • The crash dump device list. This list identifies all devices that can be used to store a crash dump.
crashconf(2) crashconf(2) includeClasses is a bitmask of classes that must be dumped. If it is set to DT_ALL , all dumps will be full dumps. Other allowed values are described under Classes, below. excludeClasses is a bitmask of classes that may not be dumped unless a full dump is required (due to the cause of the dump, or by explicit operator request). If it is set to DT_ALL , dumps will be disabled. Other allowed values are described under Classes, below.
crashconf(2) crashconf(2) char *ccerrs[] = { CCERR_STRINGS }; int num_ccerrs = sizeof(ccerrs)/sizeof(*ccerrs); char *ccwarns[] = { CCWARN_STRINGS }; int num_ccwarns = sizeof(ccwarns)/sizeof(*ccwarns); char *device_to_add[1]; int device_return[1]; ...
creat(2) creat(2) NAME creat - create a new file or rewrite an existing one SYNOPSIS #include int creat(const char *path, mode_t mode); DESCRIPTION The creat() system call creates a new regular file or prepares to rewrite an existing file named by the path name pointed to by path. If the file exists, its length is truncated to 0, and its mode and owner are unchanged. Otherwise, the file’s owner ID is set to the effective user ID of the process.
creat(2) creat(2) [EMFILE] More than the maximum number of file descriptors are currently open. [ENAMETOOLONG] The length of the specified path name exceeds PATH_MAX bytes, or the length of a component of the path name exceeds NAME_MAX bytes while _POSIX_NO_TRUNC is in effect. c [ENFILE] The system file table is full. [ENOENT] The named file does not exist (for example, path is null, or a component of path does not exist). [ENOSPC] Not enough space on the file system.
creat64(2) creat64(2) NAME creat64(), fstat64(), fstatvfs64(), getrlimit64(), lockf64(), lseek64(), lstat64(), mmap64(), open64(), pread64(), prealloc64(), pwrite64(), setrlimit64(), stat64(), statvfs64(), truncate64(), O_LARGEFILE - non-POSIX standard API interfaces to support large files SYNOPSIS #include int creat64(const char *path, mode_t mode); #include int fstat64(int fildes, struct stat64 *buf); #include
creat64(2) c creat64(2) fstat64() The fstat64() function is identical to fstat() except that fstat64() returns file status in a struct stat64 instead of a struct stat . All other functional behaviors, returns, and errors are identical. getrlimit64 The getrlimit64() function is identical to getrlimit() except that getrlimit64() passes a struct rlimit64 as its second parameter instead of a struct rlimit . All other functional behaviors, returns, and errors are identical.
creat64(2) creat64(2) For 64-bit applications, access to large files is automatic, as long as the underlying file system is enabled for large files. The interfaces on this man page are available to 64-bit applications, for convenience in porting, but provide no additional capabilities. The exception is O_LARGEFILE , which is not visible to 64-bit applications. SEE ALSO thread_safety(5).
dup(2) dup(2) NAME dup - duplicate an open file descriptor SYNOPSIS #include int dup(int fildes); DESCRIPTION fildes is a file descriptor obtained from a creat() , open() , dup() , fcntl() , or pipe() system call. dup() returns a new file descriptor having the following in common with the original: d • Same open file (or pipe). • Same file pointer (i.e., both file descriptors share one file pointer). • Same access mode (read, write or read/write).
dup2(2) dup2(2) NAME dup2 - duplicate an open file descriptor to a specific slot SYNOPSIS #include int dup2(int fildes , int fildes2 ); DESCRIPTION fildes is a file descriptor obtained from a creat() , open() , dup() , fcntl() , or pipe() system call. fildes2 is a non-negative integer less than the maximum value allowed for file descriptors. dup2() causes fildes2 to refer to the same file as fildes. If fildes2 refers to an already open file, the open file is closed first.
errno(2) errno(2) NAME errno - error indicator for function calls SYNOPSIS #include DESCRIPTION Many functions in the HP-UX operating system indicate an error condition by returning an otherwise outof-range value (usually -1). Most of these functions set the symbol errno, that is defined in errno.h, to a nonzero code value that more specifically identifies the particular error condition that was encountered.
errno(2) errno(2) [ECONNREFUSED] Connection refused. No connection could be made because the target machine actively refused it. This usually results from trying to connect to a service that is inactive on the foreign host. [ECONNRESET] Connection reset by peer. A connection was forcibly closed by a peer. This normally results from the peer executing a shutdown() call (see shutdown(2)). [EDEADLK] Resource deadlock would occur.
errno(2) errno(2) Message too long. The socket requires that the message be sent atomically, and the size of the message to be sent made this impossible. [EMSGSIZE] [ENAMETOOLONG] e File name too long. A path specified exceeds the maximum path length for the system. The maximum path length is specified by PATH_MAX and is defined in . PATH_MAX is guaranteed to be at least 1023 bytes.
errno(2) errno(2) immediately. [ENOSYS] Function is not available. The requested function or operation is not implemented or not configured in the system. [ENOTBLK] Block device required. A nonblock file was mentioned where a block device was required, such as in mount() . [ENOTCONN] Socket is not connected. A request to send or receive data was disallowed because the socket was not connected. [ENOTDIR] Not a directory.
errno(2) errno(2) Text file busy. An attempt to execute an executable file which is currently open for writing (or reading). Also, an attempt to open for writing an otherwise writable file which is currently open for execution. [ETXTBSY] [EWOULDBLOCK] Operation would block. An operation which would cause a process to block was attempted on an object in nonblocking mode (see ioctl(2) and fcntl(2)). Cross-device link. A link to a file on another device was attempted.
exec(2) exec(2) NAME exec: execl(), execle(), execlp(), execv(), execve(), execvp() - execute a file SYNOPSIS #include extern char **environ; int execl(const char *path, const char *arg0, ... /* * [const char *arg1, ... , const char *argn, ] */ (char *)0 ); int execle(const char *path, const char *arg0, ... /* * [const char *arg1, ... , const char *argn, ] */ (char *)0, char * const envp[] ); int execlp(const char *file, const char *arg0, ... /* * [const char *arg1, ...
exec(2) exec(2) file (in execlp() or execvp() ) points to a file name identifying the executable file containing the new program. The path prefix for this file is obtained by searching the directories passed in the environment variable PATH (see environ(5)). The environment is supplied by the shell (see sh(1)). If file does not have an executable magic number (see magic(4)), it is passed to the POSIX shell as a shell script. arg0, ..., argn are one or more pointers to null-terminated character strings.
exec(2) exec(2) • • • • • • • • • • process start time real-time priority (see rtprio(2)) root directory (see chroot(2)) semadj values (see semop(2)) session membership signal mask (see sigvector (2)) supplementary group IDs time left until an alarm clock signal (see alarm(2)) trace flag (see the PT_SETTRC request of ptrace(2)) tms_utime , tms_stime , tms_cutime , and tms_cstime (see times(2)) For a script file, the initial line of a script file must begin with #! as the first two bytes, followed by zer
exec(2) exec(2) recognized. [ELOOP] Too many symbolic links were encountered in translating the path name. [ENAMETOOLONG] The executable file’s path name or the interpreter’s path name exceeds PATH_MAX bytes, or the length of a component of the path name exceeds NAME_MAX bytes while _POSIX_NO_TRUNC is in effect. [ENOENT] path points to an empty string. [ENOENT] One or more components of the executable file’s path name or the interpreter’s path name does not exist.
exit(2) exit(2) NAME exit(), _exit() - terminate process SYNOPSIS #include void exit(int status); #include void _exit(int status); DESCRIPTION exit() terminates the calling process and passes status to the system for inspection, see wait(2). Returning from main in a C program has the same effect as exit() ; the status value is the function value returned by main (this value is undefined if main does not take care to return a value or to call exit() explicitly).
exit(2) exit(2) AUTHOR exit() was developed by HP, AT&T, and the University of California, Berkeley. SEE ALSO acct(2), plock(2), semop(2), shmop(2), times(2), vfork(2), pthread_exit(3T), pthread_key_create(3T), tmpfile(3S), signal(5) wait(2), atexit(3), pthread_cancel(3T), sh(1), see exit conditions ($?). STANDARDS CONFORMANCE exit() : AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1, ANSI C _exit() : AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.
fcntl(2) fcntl(2) NAME fcntl - file control SYNOPSIS #include int fcntl(int fildes, int cmd, ... /* arg */); Remarks The ANSI C ", ... " construct denotes a variable length argument list whose optional [or required] members are given in the associated comment (/* */ ). DESCRIPTION fcntl() provides for control over open files. fildes is an open file descriptor.
fcntl(2) fcntl(2) third argument, arg, taken as type int. Positive values indicate a process ID; negative values, other than -1, indicate a process group ID. F_GETLK64 Same as F_GETLK , except arg is a pointer to struct struct flock . flock64 instead of F_SETLK64 Same as F_SETLK , except arg is a pointer to struct struct flock . flock64 instead of F_SETLKW64 Same as F_SETLKW , except arg is a pointer to struct flock64 instead of struct flock .
fcntl(2) fcntl(2) F_GETFD F_SETFD F_GETFL F_SETFL F_GETLK F_SETLK F_SETLKW F_GETOWN Value of close-on-exec flag (only the low-order bit is defined). F_SETOWN F_GETLK64 F_SETLK64 F_SETLKW64 Value other than −1. Value other than −1. Value of file status flags and access modes. Value other than −1. Value other than −1. Value other than −1. Value other than −1. Value of process or process group ID specified to receive SIGURG signals when outof-band data is available. Value other than −1.
fcntl(2) fcntl(2) [EAGAIN] cmd is F_SETLK or F_SETLKW , and the file is mapped in to virtual memory via the mmap() system call (see mmap(2)). [EFAULT] cmd is either F_GETLK , F_SETLK , or F_SETLKW , and arg points to an illegal address. [ENOTSOCK] cmd is F_GETOWN or F_SETOWN , and fildes does not refer to a socket. AUTHOR fcntl() was developed by HP, AT&T and the University of California, Berkeley.
fork(2) fork(2) NAME fork - create a new process SYNOPSIS #include pid_t fork(void); DESCRIPTION The fork() system call causes the creation of a new process. The new child process is created wth exactly one thread or lightweight process. The new child process contains a replica of the calling thread (if the calling process is multi-threaded) and its entire address space, possibly including the state of mutexes and other resources.
fork(2) fork(2) If a parent and child process both have a file opened and the parent or child closes the file, the file is still open for the other process. RETURN VALUE Upon successful completion, fork() returns a value of 0 to the child process and returns the process ID of the child process to the parent process. Otherwise, a value of −1 is returned to the parent process, no child process is created, and errno is set to indicate the error.
fsctl(2) fsctl(2) NAME fsctl() - file system control SYNOPSIS #include int fsctl( int fildes, int command, void *outbuf, size_t outlen ); DESCRIPTION fsctl() provides access to file-system-specific information. fildes is an open file descriptor for a file in the file system of interest. The possible values for command depend on the type of file system. Currently, defined commands exist only for the CDFS file system (see ).
fsctl(2) fsctl(2) EXAMPLES The following code fragment gets the extended attribute record for a file on a CDFS volume. The filename is passed in as the first argument to the routine. Note that error checking is omitted for brevity. #include #include #include #include main(argc, argv) int argc; char *argv[]; { int fildes, size = 0; char *malloc(), *outbuf; struct statfs buf; struct cddir cdrec; struct cdxar_iso *xar; . . .
fstat(2) fstat(2) NAME fstat - get file status SYNOPSIS #include #include int fstat(int fildes, struct stat *buf); DESCRIPTION The fstat() function obtains information about an open file associated with the file descriptor fildes, and writes it to the area pointed to by buf. The buf argument is a pointer to a stat structure, as defined in , into which information is placed concerning the file.
fstat(2) fstat(2) • The header is now marked as optional (OH); this header need not be included on XSI-conformant systems. Issue 4, Version 2 The ERRORS section is updated for X/OPEN UNIX conformance as follows: • The [EIO] error is added as a mandatory error indicated the occurrence of an I/O error. • The [EOVERFLOW] error is added as an optional error indicating that one of the values is too large to store in the area pointed to by buf.
fstat(2) fstat(2) HP-UX EXTENSIONS DESCRIPTION If the chosen path name or file descriptor refers to a Multi-Level Directory (MLD), and the process does not have the multilevel effective privilege, the i-node number returned in st_ino is the i-node of the MLD itself. The parameters for the fstat() function is as follows: buf is a pointer to a stat() structure, which is where the file status information is stored.
fstat(2) fstat(2) write(2)). The touch command (see touch(1) can be used to explicitly control the times of a file. st_mode The value returned in this field is the bit-wise inclusive OR of a value indicating the file’s type, attribute bits, and a value summarizing its access permission. See mknod(2). For ordinary users, the least significant nine bits consist of the file’s permission bits modified to reflect the access granted or denied to the caller by optional entries in the file’s access control list.
fsync(2) fsync(2) NAME fsync, fdatasync - synchronize a file’s in-core and on-disk states SYNOPSIS #include int fsync(int fildes); int fdatasync(int fildes); DESCRIPTION fsync() and fdatasync() cause all modified data and attributes of fildes to be moved to a permanent storage device. This normally results in all in-core modified copies of buffers for the associated file to be written to a disk.
ftime(2) ftime(2) NAME ftime - get date and time more precisely SYNOPSIS #include int ftime(struct timeb *tp); Remarks This facility is provided for backwards compatibility with Version 7 systems. Either time() or gettimeofday() should be used in new programs. DESCRIPTION ftime() fills in a structure pointed to by its argument, as defined by
getaccess(2) getaccess(2) NAME getaccess - get a user’s effective access rights to a file SYNOPSIS #include int getaccess( const char *path, uid_t uid, int ngroups, const gid_t *gidset, void *label, void *privs ); DESCRIPTION getaccess() identifies the access rights (read, write, execute/search) a specific user ID has to an existing file. path points to a path name of a file.
getaccess(2) g getaccess(2) access() checks all ACL entries (HFS and JFS File Systems only) uses real uid, real gid, and supplementary groups list checks specific mode value, returns succeed or fail checks path to file using caller’s effective IDs W_OK false if shared-text file currently being executed W_OK false if file on read-only file system X_OK not modified for file currently open for writing R_OK and W_OK always true for superuser (except as above) X_OK always true for superuser getaccess() same
getaccess(2) getaccess(2) int gid = 109; int mode; mode = getaccess ("/tmp/hold", 23, 1, & gid, (void ∗) 0, (void ∗) 0); Should the need arise, the following code builds a gidset that includes the process’s effective group ID: #include int gidset [NGROUPS_MAX + 1]; int ngroups; gidset [0] = getegid(); ngroups = 1 + getgroups (NGROUPS_MAX, & gidset [1]); AUTHOR getaccess() was developed by HP. SEE ALSO access(2), acl(2), chmod(2), getacl(2), setacl(2), stat(2), acl(5), aclv(5), unistd(5).
getacl(2) getacl(2) NAME getacl, fgetacl - get access control list (ACL) information (HFS File Systems only) SYNOPSIS #include int getacl( const char *path, int nentries, struct acl_entry *acl ); int fgetacl(int fildes, int nentries, struct acl_entry *acl); DESCRIPTION getacl() returns a complete listing of all ACL entries (uid.gid, mode) in an existing file’s access control list. path points to a path name of a file.
getacl(2) getacl(2) #include entries = getacl ("/users/bill/mcfile", 0, (struct acl_entry ∗) 0); The following call returns in acl all entries in the ACL on the file opened with file descriptor 5. #include int nentries; struct acl_entry acl [NACLENTRIES]; entries = fgetacl (5, NACLENTRIES, acl); DEPENDENCIES getacl() and fgetacl() are only supported on HFS file system on standard HP-UX operating system. AUTHOR getacl() and fgetacl() were developed by HP.
getaudid(2) getaudid(2) NAME getaudid - get the audit ID (aid) for the current process SYNOPSIS #include int getaudid(void); DESCRIPTION getaudid() returns the audit ID ( aid ) for the current process. This call is restricted to the super-user. RETURN VALUE Upon successful completion, the audit ID is returned; otherwise, a -1 is returned. ERRORS getaudid() fails if the following is true: [EPERM] g The caller is not super-user. AUTHOR getaudid() was developed by HP.
getaudproc(2) getaudproc(2) NAME getaudproc - get the audit process flag for the calling process SYNOPSIS #include int getaudproc(void); DESCRIPTION getaudproc() returns the audit process flag for the calling process. The audit process flag (u_audproc) determines whether the process run by a given user should be audited. The process is audited if the returned flag is 1. If the returned flag is 0, the process is not audited. This call is restricted to the superuser.
getcontext(2) getcontext(2) NAME getcontext, setcontext - get and set current user context SYNOPSIS #include int getcontext(ucontext_t *ucp); int setcontext(const ucontext_t *ucp); DESCRIPTION The getcontext() function initializes the structure pointed to by ucp to the current user context of the calling process.
getdirentries(2) getdirentries(2) (TO BE OBSOLETED) NAME getdirentries() - get entries from a directory in a file-system-independent format SYNOPSIS #include int getdirentries( int fildes, struct direct *buf, size_t nbytes, off_t *basep ); DESCRIPTION The getdirentries() system call and the header file have been obsoleted starting from HP-UX 10.30 by the functions described in directory(3C). getdirentries() will not be supported for 64-bit applications.
getdirentries(2) getdirentries(2) (TO BE OBSOLETED) [EIO] An I/O error occurred while reading from or writing to the file system. WARNINGS Obsolescent Interfaces getdirentries() is to be obsoleted at a future date. AUTHOR getdirentries() was developed by Sun Microsystems, Inc. SEE ALSO lseek(2), open(2), directory(3C).
getdomainname(2) getdomainname(2) NAME getdomainname(), setdomainname() - get or set name of current Network Information Service (NIS) domain SYNOPSIS int getdomainname(char *name, int namelen); int setdomainname(char *name, int namelen); DESCRIPTION getdomainname() returns the name of the Network Information Service (NIS) domain for the current processor, as previously set by setdomainname(). The parameter namelen specifies the size of the name array.
getevent(2) getevent(2) NAME getevent - get events and system calls that are currently being audited SYNOPSIS #include int getevent( struct aud_type *a_syscall, struct aud_event_tbl *a_event ); DESCRIPTION getevent() gets the events and system calls being audited. The events are returned in a table pointed to by a_event. The system calls are returned in a table pointed to by a_syscall. This call is restricted to the super-user.
getfh(2) getfh(2) NAME getfh() - return file handle for file on remote node SYNOPSIS #include #include #include #include int getfh(char *path, fhandle_t *fhp); DESCRIPTION The getfh() system call returns a file handle in the struct pointed to by fhp for the file pointed to by path. This information is used to perform an NFS mount for a remote node. getfh() is executed on the remote node; results are passed back to the program doing the NFS mount.
getgroups(2) getgroups(2) NAME getgroups - get group access list SYNOPSIS #include int getgroups(int ngroups, gid_t gidset[ ]); DESCRIPTION getgroups() gets the current group access list of the user process and stores it in the array gidset. The parameter ngroups indicates the number of entries which may be placed in gidset. No more than NGROUPS_MAX , as defined in , is ever returned.
gethostid(2) gethostid(2) (TO BE OBSOLETED) NAME gethostid - get an identifier for the current host SYNOPSIS #include long gethostid(void); DESCRIPTION The gethostid() function retrieves a 32-bit identifier for the current host. RETURN VALUE Upon successful completion, gethostid() returns an identifier for the current host. ERRORS No errors are defined. APPLICATION USAGE X/Open does not define the domain in which the return value is unique.
gethostname(2) gethostname(2) NAME gethostname - get name of current host SYNOPSIS #include int gethostname(char *hostname, size_t size); DESCRIPTION gethostname() returns in the array to which hostname points, the standard host name for the current processor as set by sethostname() (see sethostname(2)). size specifies the length of the hostname array. hostname is null-terminated unless insufficient space is provided. RETURN VALUE gethostname() returns 0 if successful.
getitimer(2) getitimer(2) NAME getitimer, setitimer - get/set value of interval timer SYNOPSIS #include int getitimer(int which, struct itimerval *value); int setitimer( int which, const struct itimerval *value, struct itimerval *ovalue ); DESCRIPTION The getitimer() function stores the current value of the timer specified by which into the structure pointed to by value.
getitimer(2) getitimer(2) CHANGE HISTORY First released in Issue 4, Version 2.
getitimer(2) getitimer(2) HP-UX EXTENSIONS DESCRIPTION A timer value is defined by the itimerval structure: struct itimerval { struct timeval struct timeval }; it_interval; it_value; /* timer interval */ /* current value */ Time values smaller than the resolution of the system clock are rounded up to this resolution. The machine-dependent clock resolution is 1 / HZ seconds, where the constant HZ is defined in .
getksym(2) getksym(2) NAME getksym - get information for a global kernel symbol SYNOPSIS #include #include #include int getksym(char *symname , char *modname , uint64_t *value , uint64_t *info ); Remarks getksym is currently implemented as a macro. DESCRIPTION There are two ways that getksym can be used to retrieve kernel symbol information.
getmsg(2) getmsg(2) NAME getmsg, getpmsg - receive next message from a STREAMS file SYNOPSIS #include int getmsg( int fildes, struct strbuf *ctlptr, struct strbuf *dataptr, int *flagsp ); int getpmsg( int fildes, struct strbuf *ctlptr, struct strbuf *dataptr, int *band, int *flagsp ); g DESCRIPTION The getmsg() function retrieves the contents of a message located at the head of the stream head read queue associated with a STREAMS file and places the contents into one or more buffers.
getmsg(2) getmsg(2) the priority band of interest. In this case, getpmsg() will only process the next message if it is in a priority band equal to, or greater than, the integer pointed to by bandp, or if it is a high-priority message. If a process just wants to get the first message off the queue, the integer pointed to by bandp should be set to 0.
getpagesize(2) getpagesize(2) NAME getpagesize - get the current page size SYNOPSIS #include int getpagesize(void); DESCRIPTION The getpagesize() function returns the current page size. getpagesize() The function sysconf(_SC_PAGESIZE). is equivalent to sysconf(_SC_PAGE_SIZE) and RETURN VALUE The getpagesize() function returns the current page size. ERRORS No errors are defined.
getpeername(2) getpeername(2) NAME getpeername - get address of connected peer SYNOPSIS #include AF_CCITT only: #include
getpeername(2) getpeername(2) SEE ALSO bind(2), socket(2), getsockname(2), thread_safety(5), inet(7F), xopen_networking(7).
getpid(2) getpid(2) NAME getpid(), getpgid(), getpgrp(), getpgrp2(), getppid() - get process, process group and parent process ID. SYNOPSIS #include pid_t getpgid (pid_t pid); pid_t getpgrp(void); pid_t getpgrp2(pid_t pid); pid_t getpid(void); pid_t getppid(void); DESCRIPTION These functions return process, process group and parent process IDs, as follows: getpgid() Process group ID of the specified process. If pid is zero, the call applies to the calling process. Same result as getpgrp2() .
getpriority(2) getpriority(2) NAME getpriority, setpriority - get or set process priority SYNOPSIS #include int getpriority(int which, int who); int setpriority(int which, int who, int priority); DESCRIPTION getpriority() returns the priority of the indicated processes. setpriority() sets the priority of the indicated processes to priority.
getpriority(2) getpriority(2) SEE ALSO nice(1), renice(1M), nice(2).
getprivgrp(2) getprivgrp(2) NAME getprivgrp(), setprivgrp() - get and set special attributes for group SYNOPSIS #include int getprivgrp(struct privgrp_map *grplist); int setprivgrp(gid_t grpid, const int *mask); DESCRIPTION getprivgrp() The getprivgrp() system call returns a table of the privileged group assignments into a user-supplied structure. grplist points to an array of structures of type privgrp_map , associating a group ID with a privilege mask.
getprivgrp(2) getprivgrp(2) [EINVAL] grpid is out of range. [EPERM] The caller is not a privileged user. EXAMPLES The following example prints out PRIV_GLOBAL and the group IDs of the privilege groups to which the user belongs: #include struct privgrp_map pgrplist[PRIV_MAXGRPS]; int i; gid_t pgid; getprivgrp (pgrplist); for (i=0; i
getrlimit(2) getrlimit(2) NAME getrlimit(), setrlimit() - control maximum resource consumption SYNOPSIS #include int getrlimit(int resource, struct rlimit *rlp); int setrlimit(int resource, const struct rlimit *rlp); DESCRIPTION Limits on the consumption of a variety of resources by the calling process may be obtained with getrlimit() and set with setrlimit() . Each call to either getrlimit() or setrlimit() identifies a specific resource to be operated upon as well as a resource limit.
getrlimit(2) g getrlimit(2) RLIMIT_NOFILE This is a number one greater than the maximum value that the system may assign to a newly-created descriptor. If this limit is exceeded, functions that allocate new file descriptors may fail with errno set to [EMFILE]. This limit constrains the number of file descriptors that a process may allocate. RLIMIT_STACK This is the maximum size of a process’ stack in bytes. The implementation will not automatically grow the stack beyond this limit.
getrlimit(2) getrlimit(2) SEE ALSO brk(2), exec(2), fork(2), creat64(2), malloc(3C), open(2), sigaltstack(2), sysconf(2), ulimit(2), , . CHANGE HISTORY First released in Issue 4, Version 2.
getrusage(2) getrusage(2) NAME getrusage - get information about resource utilization SYNOPSIS #include int getrusage(int who, struct rusage *r_usage); DESCRIPTION The getrusage() function provides measures of the resources used by the current process or its terminated and waited-for child processes. If the value of the who argument is RUSAGE_SELF , information is returned about resources used by the current process.
getsid(2) getsid(2) NAME getsid() - get session ID SYNOPSIS #include pid_t getsid (pid_t pid); DESCRIPTION The getsid() function returns the session ID of the specified process. If pid is 0, the call applies to the current process. For this to be allowed, the current process and the referenced process must be in the same session. RETURN VALUE Upon successful completion, getsid() returns the session ID of the specified process.
getsockname(2) getsockname(2) NAME getsockname - get socket address SYNOPSIS #include AF_CCITT only: #include
getsockname(2) getsockname(2) SEE ALSO bind(2), socket(2), getpeername(2), thread_safety(5), inet(7F), xopen_networking(7).
getsockopt(2) getsockopt(2) NAME getsockopt(), setsockopt() - get and set options on sockets SYNOPSIS g #include
getsockopt(2) getsockopt(2) The parameters optval and optlen specify the value of the option. optval is the address of the data structure that contains the option value, and optlen is the length of the data structure. The type and value of the data structure that optval points to depends on the option. For "boolean" options, the value may be zero (not set) or non-zero (set). The value of other options depends on the purpose of the option.
getsockopt(2) getsockopt(2) buffer size can be udp_recv_hiwater_max). lowered using the ndd parameter SO_REUSEADDR (int ; boolean; AF_INET sockets only) If enabled, allows a local address to be reused in subsequent calls to bind() . Default : disallowed. SO_REUSEPORT (int ; boolean; AF_INET sockets only) If enabled, allows a local address and port to be reused in subsequent calls to bind() . Default : disallowed. SO_SNDBUF (int ) Specifies the maximum size, in bytes, of the send socket buffer.
getsockopt(2) getsockopt(2) Setting the SO_REUSEADDR option allows the local socket address to be reused in subsequent calls to bind() . This permits multiple SOCK_STREAM sockets to be bound to the same local address, as long as all existing sockets with the desired local address are in a connected state before bind() is called for a new socket. For SOCK_DGRAM sockets, SO_REUSEADDR allows multiple sockets to receive UDP multicast datagrams addressed to the bound port number.
getsockopt(2) getsockopt(2) WARNINGS Currently, the default behavior is the HP-UX BSD Sockets; however, it might be changed to X/Open Sockets in a future release. At that time, any HP-UX BSD Sockets behavior that is incompatible with X/Open Sockets might be obsoleted. Applications that conform to the X/Open specification now will avoid migration problems (see xopen_networking(7)). AUTHOR getsockopt() and setsockopt() were developed by HP and the University of California, Berkeley.
gettimeofday(2) gettimeofday(2) NAME gettimeofday - get the date and time SYNOPSIS #include int gettimeofday(struct timeval *tp, void *tzp); DESCRIPTION The gettimeofday() function obtains the current time, expressed as seconds and microseconds since 00:00 Coordinated Universal Time (UTC), January 1, 1970, and stores it in the timeval structure pointed to by tp. The resolution of the system clock is unspecified.
gettimeofday(2) gettimeofday(2) HP-UX EXTENSIONS SYNOPSIS #include int gettimeofday(struct timeval *tp, struct timezone *tzp); DESCRIPTION When gettimeofday() is called under HP-UX, extensions apply to the time zone parameter, the return value, and errors. If the tzp parameter is not a null pointer, it is interpreted as a pointer to a struct timezone under HP-UX. The struct timezone has the following fields: g tz_minuteswest The number of minutes that the local time zone is west of UTC.
gettimeofday(2) gettimeofday(2) AUTHOR gettimeofday() was developed by the University of California, Berkeley, and HP. SEE ALSO ctime(3C), date(1), ftime(2), stime(2), time(2), .
gettune(2) gettune(2) NAME gettune - get the value of a kernel tunable parameter SYNOPSIS #include int gettune(const char *tunable, uint64_t *value); DESCRIPTION This function retrieves the current value of the kernel tunable parameter named tunable. The value is passed back through the supplied value pointer. The value returned is the value for the tunable that is being used by the currently running kernel. RETURN VALUE This function returns zero for success, or -1 for an error.
getuid(2) getuid(2) NAME getuid, geteuid, getgid, getegid - get real user, effective user, real group, and effective group IDs SYNOPSIS #include uid_t getuid(void); uid_t geteuid(void); gid_t getgid(void); gid_t getegid(void); DESCRIPTION The following functions return the information indicated: getuid() geteuid() getgid() getegid() Real-user-ID of the calling process. Effective-user-ID of the calling process. g Real-group-ID of the calling process.
ioctl(2) ioctl(2) NAME ioctl - control device SYNOPSIS #include int ioctl(int fildes, int request, ... /* arg */); Remarks The ANSI C ", ... " construct denotes a variable length argument list whose optional [or required] members are given in the associated comment (/* */ ). DESCRIPTION ioctl() performs a variety of functions on character special files (devices), or regular files and directories on VxFS file systems.
ioctl(2) ioctl(2) WARNINGS Check all references to signal(5) for appropriateness on systems that support sigvector (2). sigvector (2) can affect the behavior described on this page. AUTHOR ioctl() was developed by AT&T and HP. SEE ALSO ioctl(5), arp(7P), socket(7), termio(7).
iscomsec(2) iscomsec(2) NAME iscomsec - check if the system has been converted to a trusted system. SYNOPSIS #include int iscomsec(); DESCRIPTION iscomsec returns a zero (0) if the system is not a trusted system. If the system has been converted to a trusted system, iscomsec returns a one (1). NOTES iscomsec determines if the system is a trusted system or not by checking the file, /tcb/files/auth/system/default. If the file exists, then the system is a trusted system.
kill(2) kill(2) NAME kill(), raise() - send a signal to a process or a group of processes SYNOPSIS #include int kill(pid_t pid, int sig); int raise(int sig); DESCRIPTION The kill() system call sends a signal to a process or a group of processes, as specified by pid. The signal to be sent is specified by sig and is either one from the list given in signal(2), or 0. The raise() system call sends a signal to the executing program.
kill(2) kill(2) [EINVAL] sig is neither a valid signal number nor zero. APPLICATION USAGE Threads Considerations kill() can be used to post signals to another process but cannot be used to post signals to a specific thread in another process. For information on posting signals to specific threads within the same process, see pthread_kill(3T). LWP (Lightweight Processes) Considerations Signals cannot be posted to specific LWPs in another process.
killpg(2) killpg(2) NAME bsdproc: killpg(), getpgrp(), setpgrp(), signal(), sigvec() - 4.2 BSD-compatible process control facilities SYNOPSIS #include int killpg(int pgrp, int sig); int getpgrp(int pid); int setpgrp(int pid, int pgrp); void (*signal(int sig, void (*func)(int)))(int); Obsolescent Interfaces int sigvec( int sig, struct sigvec *vec, struct sigvec *ovec ); DESCRIPTION These calls simulate (and are provided for backward compatibility with) functions of the same name in the 4.
link(2) link(2) NAME link() - link to a file SYNOPSIS #include int link(const char *path1, const char *path2); DESCRIPTION The link() system call creates a new link (directory entry) for the existing file. path1 points to a path name naming an existing file. path2 points to a path name naming the new directory entry to be created. RETURN VALUE Upon successful completion, link() returns zero. Otherwise, it returns −1 and sets errno (see errno(2)) to indicate the error.
link(2) link(2) STANDARDS CONFORMANCE link() : AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.
lio_listio(2) lio_listio(2) NAME lio_listio() - start a list of asynchronous I/O operations SYNOPSIS #include int lio_listio(int mode, struct aiocb * const list[], int nent, struct sigevent *sig); DESCRIPTION The lio_listio() function allows the calling process to request a list of asynchronous I/O operations with a single function call. The function call returns when all operation requests have been enqueued for processing.
lio_listio(2) lio_listio(2) [EINVAL] The sigevent specified by sig is not valid. [EINVAL] The mode argument is neither LIO_WAIT nor LIO_NOWAIT . [EINVAL] The value of the nent argument is negative or greater than the maximum value allowed. The maximum value allowed can be obtained using the sysconf() call with the argument _SC_AIO_LISTIO_MAX. [EINTR] The mode argument was LIO_WAIT and a signal was delivered while waiting for the requested operations to complete.
listen(2) listen(2) NAME listen - listen for connections on a socket SYNOPSIS #include int listen(int s, int backlog); DESCRIPTION To accept connections, a socket is first created using socket() , a queue for incoming connections is activated using listen() , and then connections are accepted using accept() . listen() applies only to unconnected sockets of type SOCK_STREAM.
lockf(2) lockf(2) NAME lockf - provide semaphores and record locking on files SYNOPSIS #include int lockf(int fildes, int function, off_t size); DESCRIPTION The lockf() function allows regions of a file to be used as semaphores (advisory locks) or restricts access to only the locking process (enforcement-mode record locks). Other processes that attempt to access the locked resource either return an error or sleep until the resource becomes unlocked.
lockf(2) lockf(2) A potential for deadlock occurs if a process controlling a locked resource is put to sleep by accessing the locked resource of another process. Thus, calls to fcntl() , lockf() , read() , or write() (see fcntl(2), lockf(2), read(2), and write(2)) scan for a deadlock prior to sleeping on a locked resource. Deadlock is not checked for the wait() and pause() system calls (see wait(2) and pause(2)), so potential for deadlock is not eliminated.
lockf(2) lockf(2) APPLICATION USAGE Because in the future the variable errno will be set to [EAGAIN] rather than [EACCES] when a section of a file is already locked by another process, portable application programs should expect and test for either value. For example: if (lockf(fd, F_TLOCK, siz) == -1) if ((errno == EAGAIN) || (errno == EACCES)) /* * section locked by another process * check for either EAGAIN or EACCES * due to different implementations */ else if ...
lseek(2) lseek(2) NAME lseek - move read/write file pointer, seek SYNOPSIS #include off_t lseek(int fildes, off_t offset, int whence); DESCRIPTION lseek() sets the file pointer associated with the file descriptor as follows: • If whence is SEEK_SET , the pointer is set to offset bytes. • If whence is SEEK_CUR , the pointer is set to its current location plus offset. • If whence is SEEK_END , the pointer is set to the size of the file plus offset.
lstat(2) lstat(2) NAME lstat() - get symbolic link status SYNOPSIS #include int lstat(const char *path, struct stat *buf); DESCRIPTION The lstat() function has the same effect as stat() , except when path refers to a symbolic link. In that case lstat() returns information about the link, while stat() returns information about the file the link references.
lstat(2) lstat(2) HP-UX EXTENSIONS SYNOPSIS #include DESCRIPTION If the chosen path name or file descriptor refers to a Multi-Level Directory (MLD), and the process does not have the multilevel effective privilege, the i-node number returned in st_ino is the i-node of the MLD itself. The parameters for the lstat() function is as follows: path is a pointer to a path name of any file within the mounted file system. (All directories listed in the path name must be searchable.
lstat(2) lstat(2) DEPENDENCIES (CD-ROM) The st_uid and st_gid fields are set to −1 if they are not specified on the disk for a given file. AUTHOR stat() and fstat() were developed by AT&T. lstat() was developed by the University of California, Berkeley.
madvise(2) madvise(2) NAME madvise() - advise the system of a process’s expected paging behavior SYNOPSIS #include int madvise( caddr_t addr, size_t len, int behav ); DESCRIPTION The madvise system call permits a process to advise the system about its expected future behavior in referencing a mapped file or an anonymous memory region. Certain implementations can use this information to optimize the use of resources.
madvise(2) [EINVAL] [EINVAL] madvise(2) behav contains an invalid value, or addr is not a multiple of the page size as returned by the system call sysconf(_SC_PAGE_SIZE). The address range specified by addr and len was not created by a successful call to mmap() . AUTHOR madvise() was developed by HP and OSF. SEE ALSO mmap(2), sysconf(2).
makecontext(2) makecontext(2) NAME makecontext, swapcontext - manipulate user contexts SYNOPSIS #include void makecontext(ucontext_t *ucp, (void *func)(), int argc, ...); int swapcontext(ucontext_t *oucp, const ucontext_t *ucp); DESCRIPTION The makecontext() function modifies the context specified by ucp, which has been initialized using getcontext() .
mkdir(2) mkdir(2) NAME mkdir - make a directory file SYNOPSIS #include int mkdir(const char *path, mode_t mode); DESCRIPTION The mkdir() system call creates a new directory file named by path. The file permission bits of the new directory are initialized from mode, and are modified by the process’s file mode creation mask. For each bit set in the process’s file mode creation mask, the corresponding bit in the new directory’s mode is cleared (see umask(2)).
mkdir(2) mkdir(2) [ENOENT] A component of the path prefix does not exist. [ENOSPC] Not enough space on the file system. [ENOTDIR] A component of the path prefix is not a directory. [EROFS] The named file resides on a read-only file system. [EDQUOT] User’s disk quota block or inode limit has been reached for this file system. AUTHOR mkdir() was developed by the University of California, Berkeley. SEE ALSO acl(2), chmod(2), setacl(2), stat(2), umask(2), acl(5), aclv(5), limits(5).
mknod(2) mknod(2) NAME mknod() - make directory, special, or ordinary file SYNOPSIS #include int mknod(const char *path, mode_t mode, dev_t dev); DESCRIPTION The mknod() system call creates a new file named by the path name pointed to by path. The mode of the new file is specified by the mode argument. Symbolic constants that define the file type and file access permission bits are found in the header file and are used to construct the mode argument.
mknod(2) mknod(2) [ENOENT] The path argument is null. [ENOENT] A component of the path prefix does not exist. [ENOSPC] Not enough space on the file system. [ENOTDIR] A component of the path prefix is not a directory. [EPERM] The effective-user-ID of the process does not match that of a user who has appropriate privileges, and the file type is not FIFO special. [EROFS] The directory in which the file is to be created is located on a read-only file system.
mlock(2) mlock(2) NAME mlock() - lock a segment of the process virtual address space in memory SYNOPSIS #include int mlock( const void * addr, size_t len) ; DESCRIPTION The mlock() system call allows the calling process to lock a segment of the process virtual address space into memory. Any addressable segment of the process’ address space may be locked. Locked segments are immune to all routine swapping. addr must be a valid address in the process virtual address space.
mlockall(2) mlockall(2) NAME mlockall() - lock a process virtual address space in memory SYNOPSIS #include int mlockall( constant int flags); DESCRIPTION The mlockall() system call allows the calling process to lock its entire virtual address space into memory, making it immune to all routine swapping. flags may be one or both of the following: MCL_CURRENT Lock the current process virtual address space. All addressable pages of the address space are locked.
mmap(2) mmap(2) NAME mmap - map pages of memory SYNOPSIS #include void *mmap(void *addr, size_t len, int prot, int flags, int fildes, off_t off); DESCRIPTION Note: This manpage contains HP-UX extensions. The mmap() function establishes a mapping between a process’ address space and a file.
mmap(2) mmap(2) It is unspecified whether write references by processes that have mapped the memory region using MAP_SHARED are visible to processes that have mapped the same portion of the file using MAP_PRIVATE . It is also unspecified whether write references to a memory region mapped with MAP_SHARED are visible to processes reading the file and whether writes to a file are visible to processes that have mapped the modified portion of that file, except for the effect of msync() .
mmap(2) mmap(2) [EINVAL] The mapping already exists in 32-bit address space, but the application performing the current mmap() request has been compiled as a 64-bit executable and did not specify MAP_ADDR32 in the flags argument. [EMFILE] The number of mapped regions would exceed an implementation-dependent limit (per process or per system). [ENODEV] The fildes argument refers to a file whose type is not supported by mmap() .
mmap(2) mmap(2) HP-UX EXTENSIONS NAME mmap - map pages of memory SYNOPSIS #include caddr_t mmap( caddr_t addr, size_t len, int prot, int flags, int fildes, off_t off); DESCRIPTION MAP_FILE Create a mapped file region. MAP_ANONYMOUS Create an unnamed memory region. MAP_VARIABLE Place region at implementation-computed address. MAP_NORESERVE Lazily evaluate swap space reservation. MAP_LOCAL Allocate physical memory from the current locality domain.
mmap(2) • mmap(2) addr must be a multiple of the page size returned by sysconf(_SC_PAGE_SIZE). If MAP_NORESERVE is set in flags: • no swap space is initially be reserved for the private mapping. Without this flag, the creation of a MAP_PRIVATE region reserves swap space equal to the size of the mapping. When a page in the mapping is first modified (written into), a private page is created and the swap space which had been reserved is used to hold the private copy of the data in the event of a page-out.
mmap(2) mmap(2) flag. The advisory locks of the lockf() or fcntl() interfaces have no effect on memory mapped access, but they can be used to coordinate shared access to a MAP_SHARED mapped file region. For a memory mapped file, the st_atime and st_mtime values returned by stat() are updated when a page in the memory mapped region is read from or written to the file system.
mmap(2) mmap(2) PA-RISC-based HP-UX systems allocate virtual address ranges for shared memory and shared mapped files in the range 0x80000000 through 0xefffffff for those applications compiled as 32-bit executables or for those 64-bit applications which specify MAP_SHARED and MAP_ADDR32 in the flags argument of the mmap() function.
mmap(2) mmap(2) STANDARDS CONFORMANCE mmap() : AES, SVID3 m Section 2−−160 Hewlett-Packard Company −5− HP-UX 11i Version 1: September 2005
modload(2) modload(2) NAME modload - load kernel modules on demand SYNOPSIS #include int modload(char *pathname ); DESCRIPTION modload allows processes with appropriate privilege to demand-load a kernel module into the running kernel. The module must be of a supported type and must have been registered via config(1M) or kmmodreg(1M) before it can be loaded. The module to be loaded is specified by pathname. pathname may be either a module name or an absolute pathname.
modpath(2) modpath(2) NAME modpath - change global search path for dynamically loadable kernel modules SYNOPSIS #include int modpath(const char *pathname ); DESCRIPTION modpath allows users with appropriate privilege to modify the global search path used to locate object files for dynamically loadable kernel modules. The search path modifications take effect immediately and affect all subsequent loads for all users on the system.
modstat(2) modstat(2) NAME modstat - get information for a dynamically loaded kernel module SYNOPSIS #include int modstat(int module_id , struct modstatus *stbuf , int get_next_module ); DESCRIPTION The modstat function allows processes with appropriate privilege to get information for dynamically loaded kernel modules. It fills in the elements of the modstatus structure, specified by stbuf, with the information available for the given module identifier module_id.
moduload(2) moduload(2) NAME moduload - unload a kernel module on demand SYNOPSIS #include int moduload(long module_id ); DESCRIPTION moduload allows users with appropriate privilege to demand unload one or all unloadable modules from the running kernel. A module is considered unloadable if it is not currently in use, if no module depending on it is currently loaded, and if the module is not being loaded or unloaded from the kernel.
mount(2) mount(2) NAME mount() - mount a file system SYNOPSIS #include int mount(const char *fs, const char *path, int mflag); int mount(const char *fs, const char *path, int mflag, const char *fstype, const char *dataptr, int datalen); DESCRIPTION The mount() system call requests that a file system identified by fs be mounted on the file identified by path. mflag contains a bit-mask of flags (described below). Note that the MS_DATA flag must be set for the sixargument version of the call.
mount(2) mount(2) MS_BEHIND Writes to disks are to be done asynchronously, where possible, without waiting for completion. This is the default on Series 700 systems, as it was prior to release 10.0. MS_BEHIND and MS_DELAY are mutually exclusive. MS_NO_FSASYNC Rigorous posting of file system metadata is to be used. This is the default. MS_FSASYNC Relaxed posting of file system metadata is to be used.
mpctl(2) mpctl(2) NAME mpctl - multiprocessor control SYNOPSIS #include int mpctl( mpc_request_t request, spu_t spu, pid_t pid ); int mpctl( mpc_request_t request, spu_t spu, lwpid_t lwpid ); int mpctl( mpc_request_t request, ldom_t ldom, pid_t pid ); int mpctl( mpc_request_t request, ldom_t ldom, lwpid_t lwpid ); REMARKS Much of the functionality of this capability is highly dependent on the underlying hardware.
mpctl(2) mpctl(2) semaphores). Machine Topology Information Warning: Processor and locality domain IDs are not guaranteed to exist in numerical order. There may be holes in a sequential list of IDs. Due to the capability of online addition and deletion of processors on some platforms, IDs obtained via these interfaces may be invalid at a later time. Likewise, the number of processors and locality domains in the system may also change due to processors being added or deleted.
mpctl(2) mpctl(2) Processor Set Information Warning: Dynamic creation and deletion of processor sets, and dynamic reassignment of a processor from one processor set to another may occur. All processors in the system comprises one processor set by default at boot time until new processor sets are created and configured by users. The following command requests return topology information on processors and locality domains in the processor set of the calling thread.
mpctl(2) mpctl(2) Setting the processor or locality domain binding will fail if the target processor or locality domain is not in the processor set of the specified process or LWP. Warning: Due to the capability of online addition and deletion of processors on some platforms, processors may go away. If this occurs, any processes or LWPs bound to a departing processor will be rebound to a different processor with the same binding type.
mpctl(2) mpctl(2) MPC_SETLWP_FORCE This call is identical to MPC_SETLWP except that the processor binding will take precedence over the scheduling policy. This call is synchronous. For example, when a processor is ready choose another LWP to execute, and the highest priority SCHED_FIFO LWP is bound to a different processor, that LWP will not be selected to execute on the selecting processor, but instead wait for the specified processor to which it was bound.
mpctl(2) mpctl(2) Obtaining Processor and Locality Domain Binding Type These options return the current binding type for the specified process or LWP. int mpctl(mpc_request_t request, spu_t spu, pid_t pid); int mpctl(mpc_request_t request, spu_t spu, lwpid_t lwpid); The request argument determines the precise action to be taken by mpctl and is one of the following: MPC_GETPROCESS_BINDINGTYPE Warning: This call is OBSOLETE and is only provided for backwards compatibility.
mpctl(2) mpctl(2) system. For example, a system which contains 4 locality domains, each containing 32 processors, may exhibit different performance behaviors from a system that contains 32 locality domains with 4 processors per domain. The launch policy that provides optimal performance on one system may not provide optimal performance on a different system for the same application.
mpctl(2) mpctl(2) continue working on future releases. The ldom argument is ignored. MPC_SETLWP_RR This call establishes a round robin policy for the specified LWP. Round robin indicates that successive child LWPs are launched on different locality domains until all domains in the system have been used by LWPs in this process. At that point, the selection of locality domains begins again from the system wide pool of domains.
mpctl(2) mpctl(2) SEE ALSO getprivgrp(1), setprivgrp(1M), getprivgrp(2), fork(2), privgrp(4), sysconf(2), pthread_processor_bind_np(3T).
mprotect(2) mprotect(2) NAME mprotect - set or check protection of memory mapping SYNOPSIS #include int mprotect(void *addr, size_t len, int prot); DESCRIPTION The mprotect() function changes the access protections on the mappings specified by the range [addr, addr+len], rounding len up to the next multiple of the page size as returned by sysconf() , to be that specified by prot. Legitimate values for prot are the same as those permitted for mmap() and are defined in
mprotect(2) mprotect(2) HP-UX EXTENSIONS SYNOPSIS int mprotect( caddr_t addr, size_t len, int prot ); DESCRIPTION If the address range does not correspond to one created by a successful call to mmap() , mprotect() returns an error. prot determines whether read, write, execute, or some combination of accesses are permitted to the data being mapped.
mq_close(2) mq_close(2) NAME mq_close - close a message queue descriptor SYNOPSIS #include int mq_close(mqd_t mqdes); DESCRIPTION The mq_close() system call removes the association between the message queue descriptor, mqdes, and a message queue.
mq_getattr(2) mq_getattr(2) NAME mq_getattr - get status information and attributes associated with a message queue SYNOPSIS #include int mq_getattr(mqd_t mqdes, struct mq_attr *mqstat); DESCRIPTION The mq_getattr() system call collects status information and attributes associated with the message queue specified by mqdes which is copied into the mq_attr structure referenced by mqstat.
mq_notify(2) mq_notify(2) NAME mq_notify - register/cancel a notification request with a message queue SYNOPSIS #include int mq_notify(mqd_t mqdes, const struct sigevent *notification); DESCRIPTION If the argument notification is not NULL , the mq_notify() system call registers the calling process to be notified of message arrival at an empty message queue associated with the message queue descriptor mqdes.
mq_open(2) mq_open(2) NAME mq_open - create/open a message queue SYNOPSIS #include mqd_t mq_open(const char *name, int oflag, ... /* * [mode_t mode, struct mq_attr ] */ ); Remarks The ANSI C ", ... " construct specifies a variable length argument list whose optional members are given in the associated comment (/* */ ). DESCRIPTION The mq_open() system call establishes a connection between a process and a message queue.
mq_open(2) mq_open(2) b. Contain no pathname component consisting of a dot or dot-dot; e.g., /./tmp and /../tmp . c. Contain no illegal characters. d. Contain no pathname components longer that _POSIX_NAME_MAX. e. Entire name should not be longer that _POSIX_PATH_MAX. RETURN VALUE mq_open() returns the following values: n Successful completion. n is a message queue descriptor for the opened message queue and is greater than or equal to 0. -1 Failure. errno is set to indicate the error.
mq_receive(2) mq_receive(2) NAME mq_receive - receive a message from a message queue SYNOPSIS #include ssize_t mq_receive(mqd_t char size_t unsigned int ); mqdes, *msg_ptr, msg_len, *msg_prio DESCRIPTION The mq_receive() system call receives the oldest of the highest priority message from the message queue specified by mqdes. The selected message is removed from the queue and copied to the buffer pointed to by the msg_ptr argument.
mq_send(2) mq_send(2) NAME mq_send - send a message to a message queue SYNOPSIS #include int mq_send(mqd_t const char size_t unsigned int ); mqdes, *msg_ptr, msg_len, msg_prio DESCRIPTION The mq_send() system call adds a message pointed to by the argument msg_ptr to the message queue specified by mqdes. The msg_len argument specifies the length of the message in bytes.
mq_setattr(2) mq_setattr(2) NAME mq_setattr - set the blocking status of a message queue associated with a descriptor SYNOPSIS #include int mq_setattr(mqd_t mqdes, const struct mq_attr *mqstat, struct mq_attr *omqstat, ); DESCRIPTION The mq_setattr() system call changes the blocking status of a message queue associated with the descriptor, mqdes.
mq_unlink(2) mq_unlink(2) NAME mq_unlink - unlink a message queue SYNOPSIS #include int mq_unlink(const char *name); DESCRIPTION The mq_unlink() system call disassociates the queue name, from a message queue specified by the argument, name. After a successful call to mq_unlink() , attempts to open a message queue with the same name will fail, if the flag O_CREAT is not set in oflags. If there are no processes with existing open descriptors for the message queue, the queue is destroyed.
msem_init(2) msem_init(2) NAME msem_init - initialize a semaphore in a mapped file or anonymous memory region SYNOPSIS #include msemaphore *msem_init(msemaphore *sem, int initial_value); DESCRIPTION msem_init() allocates a new binary semaphore and initializes the state of the new semaphore. sem points to an msemaphore structure in which the state of the semaphore is to be stored. If initial_value is MSEM_LOCKED , the new semaphore is initialized in the locked state.
msem_lock(2) msem_lock(2) NAME msem_lock - lock a semaphore SYNOPSIS #include int msem_lock(msemaphore *sem, int condition); DESCRIPTION msem_lock() attempts to lock a binary semaphore. sem points to an msemaphore structure which specifies the semaphore to be locked. If the semaphore is not currently locked, it becomes locked and the function returns successfully. If the semaphore is currently locked, and condition is MSEM_IF_NOWAIT, then the function returns with an error.
msem_remove(2) msem_remove(2) NAME msem_remove - remove a semaphore in mapped file or anonymous region SYNOPSIS #include int *msem_remove(msemaphore *sem); DESCRIPTION msem_remove() removes a binary semaphore. sem points to an msemaphore structure that specifies the semaphore to be removed. Any subsequent use of the msemaphore structure before it is again initialized by calling msem_init() produces undefined results.
msem_unlock(2) msem_unlock(2) NAME msem_unlock - unlock a semaphore SYNOPSIS #include int msem_unlock(msemaphore *sem, int condition); DESCRIPTION msem_unlock() unlocks a binary semaphore. sem points to an msemaphore structure that specifies the semaphore to be unlocked. If the condition argument is zero, the semaphore will be unlocked, whether or not any other processes are currently attempting to lock it.
msgctl(2) msgctl(2) NAME msgctl - message control operations SYNOPSIS #include int msgctl(int msqid, int cmd, struct msqid_ds *buf); DESCRIPTION msgctl() provides a variety of message control operations as specified by cmd. The following cmds are available: IPC_STAT Place the current value of each member of the data structure associated with msqid into the structure pointed to by buf. The contents of this structure are defined in glossary(9).
msgctl(2) msgctl(2) SEE ALSO ftok(3C), ipcrm(1), ipcs(1), msgget(2), msgop(2).
msgget(2) msgget(2) NAME msgget - get message queue SYNOPSIS #include int msgget(key_t key, int msgflg); DESCRIPTION msgget() returns the message queue identifier associated with key. A message queue identifier and associated message queue and data structure are created for key if one of the following is true: key is equal to IPC_PRIVATE . This call creates a new identifier, subject to available resources.
msgop(2) msgop(2) NAME msgsnd, msgrcv - message operations SYNOPSIS #include int msgsnd( int msqid, const void *msgp, size_t msgsz, int msgflg ); int msgrcv( int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg ); DESCRIPTION The msgsnd() system call sends a message to the queue associated with the message queue identifier specified by msqid.
msgop(2) msgop(2) long char mtype; mtext[]; /* message type */ /* message text */ mtype is the received message’s type as specified by the sending process. mtext is the text of the message. msgsz specifies the size in bytes of mtext . The received message is truncated to msgsz bytes if it is larger than msgsz and (msgflg & MSG_NOERROR ) is true. The truncated part of the message is lost and no indication of the truncation is given to the calling process.
msgop(2) msgop(2) [EACCES] [EAGAIN] Operation permission is denied to the calling process. The message cannot be sent for one of the reasons cited above and (msgflg & IPC_NOWAIT ) is true. [EFAULT] msgp points to an illegal address. The reliable detection of this error is implementation dependent. [EIDRM] The message queue identifier msqid has been removed from the system. [EINTR] msgsnd() was interrupted by a signal. [EINVAL] msqid is not a valid message queue identifier.
msync(2) msync(2) NAME msync - synchronize memory with physical storage SYNOPSIS #include int msync(void *addr,size_t len, int flags); DESCRIPTION The msync() function writes all modified copies of pages over the range [addr, addr+len] to the underlying hardware, or invalidates any copies so that further references to the pages will be obtained by the system from their permanent storage locations.
msync(2) msync(2) SEE ALSO mmap(2), sysconf(2). . CHANGE HISTORY First released in Issue 4, Version 2.
msync(2) msync(2) HP-UX EXTENSIONS NAME msync - synchronize a mapped file SYNOPSIS int msync(caddr_t addr,size_t len, int flags); DESCRIPTION msync controls the caching operations of a mapped file region. addr and len specify the region to be synchronized. If these are not the address and length of a region created by a previous successful call to mmap() , msync() returns an error. The behavior of msync() upon a region created with the MAP_ANONYMOUS or MAP_PRIVATE flags is undefined.
munlock(2) munlock(2) NAME munlock() - unlock a segment of the process virtual address space SYNOPSIS #include int munlock( const void * addr, size_t len) ; DESCRIPTION The munlock() system call allows the calling process to unlock a segment of the process virtual address space that may have been previously locked with mlock() or mlockall() . Upon successful completion of the munlock() , pages within the specified segment are subject to routine paging and/or swapping.
munlockall(2) munlockall(2) NAME munlockall() - unlock the entire virtual address space of a process SYNOPSIS #include int munlockall() ; DESCRIPTION The munlockall() system call allows the calling process to unlock any portions of its virtual address space that have previously been locked into memory with mlock() or mlockall() , including any portions locked due to the MCL_FUTURE option of mlockall() .
munmap(2) munmap(2) NAME munmap - unmap pages of memory SYNOPSIS #include int munmap(void *addr, size_t len); DESCRIPTION The munmap() function removes the mappings for pages in the range [addr, addr+len], rounding the len argument up to the next multiple of the page size as returned by sysconf() . If addr is not the address of a mapping established by a prior call to mmap() , the behaviour is undefined.
munmap(2) munmap(2) HP-UX EXTENSIONS SYNOPSIS int munmap(caddr_t addr, size_t len); DESCRIPTION munmap() unmaps a mapped file or anonymous memory region. If the address range specified by addr and len was not created by a successful call to mmap() , munmap() returns an error. If the specified address range was created by multiple calls to mmap() , munmap() succeeds in unmapping all of the specified regions, provided they form a contiguous address range.
nanosleep(2) nanosleep(2) NAME nanosleep() - high resolution sleep SYNOPSIS #include int nanosleep( const struct timespec *rqtp, struct timespec *rmtp ); DESCRIPTION The nanosleep() function causes the current process to be suspended from execution until either the time interval specified by the rqtp argument has elapsed, or a signal is delivered to the calling process and its action is to invoke a signal-catching function or to terminate the process.
nanosleep(2) nanosleep(2) SEE ALSO clocks(2), timers(2), sleep(3C), thread_safety(5). STANDARDS CONFORMANCE nanosleep() : POSIX.
nice(2) nice(2) NAME nice - change priority of a process SYNOPSIS #include int nice(int priority_change); DESCRIPTION nice() adds the value of priority_change to the nice value of the calling process. A process’s nice value is a positive number for which a more positive value results in lower CPU priority. A maximum nice value of 39 and a minimum nice value of 0 are imposed by the system.
open(2) open(2) NAME open() - open file for reading or writing SYNOPSIS #include int open(const char *path, int oflag, ... /* [mode_t mode ] */ ); Remarks The ANSI C ", ... " construct specifies a variable length argument list whose optional member is given in the associated comment (/* */). DESCRIPTION The open() system call opens a file descriptor for the named file and sets the file status flags according to the value of oflag.
open(2) open(2) When opening a FIFO with O_RDONLY or O_WRONLY set: If O_NDELAY is set: A read-only open() returns without delay. A write-only open() returns an error if no process currently has the file open for reading. If O_NDELAY is clear: A read-only open() does not return until a process opens the file for writing. A write-only open() does not return until a process opens the file for reading.
open(2) open(2) n Successful completion. n is a file descriptor for the opened file. -1 Failure. errno is set to indicate the error. ERRORS If open() fails, errno is set to one of the following values. [EACCES] oflag permission is denied for the named file. [EACCES] A component of the path prefix denies search permission. [EACCES] The file does not exist and the directory in which the file is to be created does not permit writing. [EACCES] O_TRUNC is specified and write permission is denied.
open(2) open(2) int infd; infd = open ("inputfile", O_RDONLY); The following call to open() opens file outputfile for writing and returns a file descriptor for outputfile . For an example of preallocating disk space for outputfile , see the prealloc(2) manual entry. For an example of writing to outputfile , see the write(2) manual entry. int outfd; outfd = open ("outputfile", O_WRONLY); The following call opens file iofile for synchronized I/O file integrity for reads and writes.
pathconf(2) pathconf(2) NAME pathconf( ), fpathconf( ) - get configurable path name variables SYNOPSIS #include long pathconf(const char *path, int name); long fpathconf(int fildes, int name); DESCRIPTION The pathconf() and fpathconf() functions provide a method for applications to determine the value of a configurable limit or option associated with a file or directory (see limits(5) and ). For pathconf() , the path argument points to the path name of a file or directory.
pathconf(2) 9. pathconf(2) _POSIX_CHOWN_RESTRICTED is undefined and pathconf() or fpathconf() returns −1 without changing errno . To determine if chown() can be performed on a file, it is simplest to attempt the chown() operation and check the return value for failure or success. _POSIX_SYNC_IO, when defined, determines whether synchronized IO operations may be performed for the associated file (see open(2)).
pathconf(2) pathconf(2) } } /* otherwise, _POSIX_NO_TRUNC is in effect for this directory */ if ((fd = open(filebuf, O_CREAT, mode)) < 0) perror(filebuf); DEPENDENCIES NFS The following error can occur: [EOPNOTSUPP] path or fildes refers to a file for which a value for name cannot be determined. In particular, _PC_LINK_MAX , _PC_NAME_MAX , _PC_PIPE_BUF , _PC_PATH_MAX , _PC_NO_TRUNC , and _PC_CHOWN_RESTRICTED, cannot be determined for an NFS file. AUTHOR pathconf() and fpathconf() were developed by HP.
pause(2) pause(2) NAME pause - suspend process until signal SYNOPSIS #include int pause(void); DESCRIPTION pause() suspends the calling process until it receives a signal. The signal must be one that is not currently set to be ignored or blocked (masked) by the calling process. If the signal causes termination of the calling process, pause() does not return.
pipe(2) pipe(2) NAME pipe() - create an interprocess channel SYNOPSIS int pipe(int fildes[2]); DESCRIPTION pipe() creates an I/O mechanism called a pipe and returns two file descriptors, fildes[0] and fildes[1]. fildes[0] is opened for reading and fildes[1] is opened for writing. A read-only file descriptor fildes[0] accesses the data written to fildes[1] on a first-in-first-out (FIFO) basis. For details of the I/O behavior of pipes see read(2) and write(2). By default, HP-UX pipes are not STREAMS-based.
pipe(2) pipe(2) [ENOSPC] The file system lacks sufficient space to create the pipe. [ENOSR] Could not allocate resources for both Stream heads (STREAMS-based pipes only). SEE ALSO sh(1), read(2), write(2), popen(3S), thread_safety(5), streamio(7) STANDARDS CONFORMANCE pipe() : AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.
plock(2) plock(2) NAME plock() - lock process, text, data, stack, or shared library in memory SYNOPSIS #include int plock(int op); DESCRIPTION The plock() system call allows the calling process to lock the text segment of the process (text lock), its data segment (data lock), or both its text and data segment (process lock) into memory. Stack segments are also locked when data segments are locked. Shared library text and shared library data segments (shlib lock) can also be locked.
plock(2) plock(2) [EINVAL] op is not equal to one of the values specified in DESCRIPTION. [EINVAL] plock() is not allowed in a [vfork ,exec ] window. See vfork(2). [ENOMEM] There is not enough lockable memory in the system to satisfy the locking request. [EPERM] The effective user ID of the calling process is not a superuser and the user does not belong to a group that has the MLOCK privilege.
poll(2) poll(2) NAME poll - monitor I/O conditions on multiple file descriptors SYNOPSIS #include int poll( struct pollfd fds[], nfds_t nfds, int timeout ); DESCRIPTION poll() provides a general mechanism for reporting I/O conditions associated with a set of file descriptors and for waiting until one or more specified conditions becomes true. Specified conditions include the ability to read or write data without blocking, and error conditions.
poll(2) poll(2) POLLMSG A M_SIG or M_PCSIG message specifying SIGPOLL has reached the front of the stream head read queue. The conditions indicated by POLLNORM and POLLOUT are true if and only if at least one byte of data can be read or written without blocking. The exception is regular files, which always poll true for POLLNORM and POLLOUT . Also, streams return POLLNORM in revents even if the available message is of zero length.
poll(2) poll(2) fds[2].events = POLLOUT; count = poll(fds, 3, 10000); if (count == -1) { perror("poll failed"); exit(1); } if (count==0) printf("No data for reading or writing\n"); if (fds[0].revents & POLLNORM) printf("There is data for reading fd %d\n", fds[0].fd); if (fds[1].revents & POLLNORM) printf("There is data for reading fd %d\n", fds[1].fd); if (fds[2].revents & POLLOUT) printf("There is room to write on fd %d\n", fds[2].
prealloc(2) prealloc(2) NAME prealloc - preallocate fast disk storage SYNOPSIS #include int prealloc(int fildes, off_t size); DESCRIPTION prealloc() is used to preallocate space on a disk for faster storage operations. fildes is a file descriptor obtained from a creat() , open() , dup() , or fcntl() system call for an ordinary file of zero length. It must be opened writable, because it will be written to by prealloc() .
profil(2) profil(2) NAME profil - execution time profile SYNOPSIS #include void profil( unsigned short int *buff, size_t bufsiz, size_t offset, unsigned int scale ); DESCRIPTION profil() controls profiling, by which the system maintains estimates of the amount of time the calling program spends executing at various places in its address space. The buff argument must point to an area of memory whose length (in bytes) is given by bufsiz.
pset_assign(2) pset_assign(2) NAME pset_assign() - change processor set assignment SYNOPSIS #include int pset_assign( psetid_t pset, spu_t spu, psetid_t *opset); DESCRIPTION The pset_assign() function assigns the processor spu to the processor set pset, removing the processor spu from its current processor set. A processor may not belong to more than one processor set at any given time.
pset_assign(2) pset_assign(2) if ((ret = pset_assign(new_pset, spu, &old_pset)) < 0) { perror("pset_assign"); exit(1); } RETURN VALUE pset_assign returns zero on successful completion. Otherwise, -1 is returned and errno is set to indicate the error. ERRORS pset_assign fails if one or more of the following is true: [EBUSY] The processor set currently assigned to the processor spu has active threads and processes, and the processor set attributes do not allow this operation.
pset_bind(2) pset_bind(2) NAME pset_bind() - bind process or thread to a processor set SYNOPSIS #include int pset_bind( psetid_t pset, idtype_t idtype, id_t id, psetid_t *opset); DESCRIPTION The pset_bind() function binds thread(s) or process(es) specified by idtype and id to the processor set pset. If idtype is P_PID , then id specifies the pid of the process to be assigned, and the binding affects all threads of the process.
pset_bind(2) pset_bind(2) The child process and its first thread created by a fork() or vfork() function will inherit the processor set binding from the parent process. The new threads in the multi-threaded process will inherit their processor set binding from the creator thread. EXAMPLE Migrate the current thread to another processor set new_pset, and retrieve its current processor set in old_pset. #include int ret; psetid_t new_pset, old_pset; /* * Initialize new_pset first.
pset_create(2) pset_create(2) NAME pset_create() - create a processor set SYNOPSIS #include int pset_create( psetid_t *newpset); DESCRIPTION The pset_create() function creates an empty processor set with no processors. Processor sets allow a subset of processors in the system to be isolated for exclusive use by specified threads and processes. Only the threads bound to a processor set can execute on processors in that processor set.
pset_create(2) pset_create(2) PSET_ATTR_OWNID UID of the processor set owner. The processor set creator is the default owner. PSET_ATTR_PERM Access permissions for the processor set. By default, the processor set owner has all permissions, whereas group and others have only READ and EXEC permissions. Processor sets define a scheduling allocation domain for threads and processes. All threads may execute only on processors within the assigned processor set.
pset_ctl(2) pset_ctl(2) NAME pset_ctl - processor set control SYNOPSIS #include int pset_ctl( pset_request_t request, psetid_t pset, id_t id); DESCRIPTION The pset_ctl() function provides a means to query the system processor set configuration and assignment information. The request argument specifies what information is needed for the pset processor set. The following request values are supported: PSET_GETCURRENTPSET Return the ID of the processor set binding for the calling thread.
pset_ctl(2) pset_ctl(2) PSET_SPUTOPSET Return the ID of the processor set assigned for the processor specified in id. If the processor is not enabled or is in transition from one processor set to another, -1 is returned with an error. The pset argument is ignored. Any user may query the system processor set topology using the pset_ctl() function. Use sysconf() with _SC_PSET_SUPPORT name to see if the processor set functionality is supported by the underlying HP-UX operating system version.
pset_ctl(2) [ENOSYS] pset_ctl(2) The processor set functionality is not supported by the underlying HP-UX version. AUTHOR pset_ctl was developed by HP. SEE ALSO psrset(1M), pset_assign(2), pset_bind(2), pset_create(2), pset_destroy(2), pset_getattr(2), pset_setattr(2), sysconf(2).
pset_destroy(2) pset_destroy(2) NAME pset_destroy() - destroy a processor set SYNOPSIS #include int pset_destroy( psetid_t pset); DESCRIPTION The pset_destroy() function destroys the processor set pset, releasing all constituent processors and processes by default. The processors and processes are reassigned to the system default processor set. Once destroyed, the pset identifier becomes available for new processor sets that may be created in the future.
pset_destroy(2) pset_destroy(2) SEE ALSO psrset(1M), getprivgrp(2), pset_assign(2), pset_bind(2), pset_create(2), pset_ctl(2), pset_getattr(2) p Section 2−−234 Hewlett-Packard Company −2− HP-UX 11i Version 1: September 2005
pset_getattr()(2) pset_getattr()(2) NAME pset_getattr(), pset_setattr() - manage processor set attributes SYNOPSIS #include int pset_getattr( psetid_t pset, pset_attrtype_t type, pset_attrval_t* val); int pset_setattr( psetid_t pset, pset_attrtype_t type, pset_attrval_t val); DESCRIPTION The pset_getattr() function returns the current value of the attribute type for the processor set pset in the memory location pointed to by val.
pset_getattr()(2) pset_getattr()(2) A superuser, a PRIV_PSET privilege user, or the pset owner may change value of the PSET_ATTR_PERM attribute. PSET_ATTR_IOINTR A value of PSET_ATTRVAL_ALLOW indicates that processors in this processor set are configured to receive external interrupts. It may be assigned a value of PSET_ATTRVAL_DISALLOW to disable all processors in the processor set from receiving and processing external I/O interrupts. Not all platforms may support this feature.
pset_getattr()(2) pset_getattr()(2) ERRORS pset_getattr() or pset_setattr() fails if one or more of the following is true: [EFAULT] The memory location pointed to by val is not writable by the user for pset_getattr(). [EINVAL] The specified processor set pset, the attribute type, or the attribute val is invalid. [EINVAL] The memory location pointed to by val is NULL for pset_getattr(). [ENOSYS] The processor set functionality is not supported by the underlying HP-UX version.
pstat(2) pstat(2) NAME pstat(), pstat_getcrashdev(), pstat_getcrashinfo(), pstat_getdisk(), pstat_getdynamic(), pstat_getfile(), pstat_getfile2(), pstat_getfiledetails(), pstat_getipc(), pstat_getlv(), pstat_getlwp(), pstat_getmpathname(), pstat_getmsg(), pstat_getnode(), pstat_getpathname(), pstat_getproc(), pstat_getprocessor(), pstat_getprocvm(), pstat_getpset(), pstat_getsem(), pstat_getshm(), pstat_getsocket(), pstat_getstable(), pstat_getstatic(), pstat_getstream(), pstat_getswap(), pstat_getvminfo(
pstat(2) pstat(2) ); int pstat_getnode( struct pst_node *buf, size_t elemsize, size_t elemcount, int index ); int pstat_getpathname( char *buf, size_t elemcount, struct pst_fid *fid ); int pstat_getproc( struct pst_status *buf, size_t elemsize, size_t elemcount, int index ); int pstat_getprocessor( struct pst_processor *buf, size_t elemsize, size_t elemcount, int index ); int pstat_getprocvm( struct pst_vm_status *buf, size_t elemsize, size_t elemcount, int index ); int pstat_getpset( struct pst_pset *buf
pstat(2) pstat(2) int pstat( int, union pstun, size_t, size_t, int ); Remarks The underlying function pstat() is provided for backward compatibility. Use of the pstat_get*() wrapper functions is recommended (for example, pstat_getproc()) to avoid the polymorphic typing of the union pstun parameter. DESCRIPTION The pstat functions return information about various system contexts.
pstat(2) pstat(2) pstat_getcrashinfo() Returns information about the system’s crash dump configuration. Data, up to a maximum of elemsize bytes, are returned in the struct pst_crashinfo pointed to by buf . The elemcount parameter must be 1. The index parameter must be 0. pstat_getdisk() Returns information specific to a particular disk. There is one instance of this context for each disk configured into the system.
pstat(2) pstat(2) there is only one instance of this context. For each call, data up to a maximum of elemsize bytes are returned in the struct pst_filedetails pointed to by buf . The fid parameter uniquely identifies the file. This fid is obtained from calls to pstat_getfile(), pstat_getproc(), or pstat_getprocvm(). The pst_filedetails structure contains information equivalent to the stat(2) call. Use of this function is limited to UID==0 or effective UID match.
pstat(2) pstat(2) struct psfileid psr_file; struct psfileid psr_parent; char psr_name[PS_SEGMENTNAME_SZ]; psr_idx is the current index of an entry into the chain of DNLC entries for the filesystem. psr_idx +1 can be passed on to another pstat_getmpathname() call as the index parameter to obtain the entries starting after the last psr_idx . psr_file is the file the current entry describes and psr_parent is the parent of this file. psr_name is the NULL terminated pathname component for the current entry.
pstat(2) pstat(2) instance requested, data, up to a maximum of elemsize bytes, are returned in the struct s pst_processor pointed to by buf . The elemcount parameter specifies the number of struct s pst_processor that are available at buf to be filled in. The index parameter specifies the starting index within the context of processors. pstat_getprocvm() Returns information specific to a particular process’ address space.
pstat(2) pstat(2) pst_hi_nodeid and pst_lo_nodeid. The members pst_boundaddr and pst_remaddr contain data of the form struct sockaddr, sockaddr_un, sockaddr_in, sockaddr_in6 , etc. depending on the socket family. pstat_getstable() Returns information contained in the system’s stable storage area. There is one global instance of this context. Data, up to a maximum of elemsize bytes, are returned in the struct pst_stable pointed to by buf . The elemcount parameter must be 1. The index parameter must be 0.
pstat(2) pstat(2) RETURN VALUE Upon successful completion, pstat() and the various wrapper routines (for example, pstat_getprocessor()) return the number of instances filled in at the address buf . Otherwise, a value of −1 is returned and errno is set to indicate the error. ERRORS The pstat functions fail if any of the following conditions are encountered: [EFAULT] buf/fid points to an invalid address. [ESRCH] Process in question is not found or exiting.
pstat(2) pstat(2) [ENOSYS] The requested pstat function is not implemented or not configured in the system. BACKWARD COMPATIBILITY The specific calling convention of passing the expected data structure size is used in order to allow for future expansion of the interface, while preserving backwards source and object compatibility for programs written using the pstat interfaces. Three rules are followed to allow existing applications to continue to execute from release to release of the operating system.
pstat(2) pstat(2) } else perror("pstat_getdynamic"); } else p perror("pstat_getdynamic"); } /* * Example 3: get information about all per-process -- 10 at a time * done this way since current count of active processes unknown */ { #define BURST ((size_t)10) struct pst_status pst[BURST]; int i, count; int idx = 0; /* index within the context */ /* loop until count == 0, will occur all have been returned */ while ((count=pstat_getproc(pst, sizeof(pst[0]),BURST,idx))>0) { /* got count (max of BURST) this t
pstat(2) pstat(2) (void)printf("owner\tkey\tsize\n"); for (i = 0; i < num_shm; i++) { /* skip inactive segments */ if (!(pss[i].psh_flags & PS_SHM_ALLOC)) continue; (void)printf("%d\t%#x\t%d\n", pss[i].psh_uid, pss[i].psh_key, pss[i].
pstat(2) pstat(2) if (count == -1) perror("pstat_getlwp()"); else ... p } /* * Example 8: Acquire detailed information about a specific file */ main() { struct pst_fileinfo2 psf; struct pst_filedetails psfdetails; int count, fd; fd = open("/stand/vmunix", O_RDONLY); count = pstat_getfile2(&psf, sizeof(psf), 0, fd, getpid()); if (count == 1) { count = pstat_getfiledetails(&psfdetails, sizeof(psfdetails), &psf.psf_fid); if (count == 1) { if ((psfdetails.psfd_hi_fileid == psf.psf_hi_fileid) && (psfdetails.
pstat(2) pstat(2) count = pstat_getstream(psfstream, sizeof(struct pst_stream), 3, 0, &(psf.psf_fid)); if (count > 0) { if ((psfstream[0].val.head.pst_hi_fileid == psf.psf_hi_fileid) && (psfstream[0].val.head.pst_lo_fileid == psf.psf_lo_fileid) && (psfstream[0].val.head.pst_hi_nodeid == psf.psf_hi_nodeid) && (psfstream[0].val.head.pst_lo_nodeid == psf.psf_lo_nodeid)) { printf("Success\n"); printf("The major number of the stream is %d\n", psfstream[0].val.head.
pstat(2) pstat(2) perror("pstat_getfile2"); } close(fd); } /* * Example 11: Acquire pathname information about opened file */ main() { struct pst_fileinfo2 psf; char filename[20]; int rv, count, fd; fd = open("/etc/passwd", O_RDONLY); rv = pstat_getfile2(&psf, sizeof(psf), 0, fd, getpid()); if (rv == 1) { /* * Ask for pathname information. */ count = pstat_getpathname(filename, 20, &(psf.
pstat(2) pstat(2) * Ask for multiple pathname information. */ count = pstat_getmpathname(mpath_buf, sizeof(struct pst_mpathnode), 20, 0, &(psf.psf_id.psf_fsid)); if (count > 0) { for (i = 0; i < count; i++) { printf("component %d: %s\n", i, mpath_buf[i].
ptrace(2) ptrace(2) NAME ptrace() - process trace SYNOPSIS #include int ptrace( int request, pid_t pid, int addr, int data, int addr2 ); Remarks Much of the functionality of ptrace() is highly dependent on the underlying hardware. An application that uses this system call should not be expected to be portable across architectures or implementations. DESCRIPTION The ptrace() system call provides a means by which a process can control the execution of another process.
ptrace(2) ptrace(2) This request fails if addr is not the start address of a word or is outside the user area, in which case a value of −1 is returned to the tracing process and its errno is set to [EIO]. PT_WDUSER PT_WIUSER With these requests, the value given by the data argument is written into the address space of the traced process at location addr. PT_WIUSER writes a word into I space, and PT_WDUSER writes a word in D space.
ptrace(2) ptrace(2) the effective user ID of the tracing process is superuser. The calling process can use the wait() system call to wait for process pid to stop. The addr, data, and addr2 arguments are ignored. PT_DETACH This request detaches the traced process pid and allows it to continue its execution in the manner of PT_CONTIN . If the addr argument is not 1, the Instruction Address Offset Queue (program counter) is loaded with the values addr and addr2.
ptrace(2) ptrace(2) details. It is important to note that the warnings with respect to vfork() (see vfork(2)), continue to apply here. In particular, it needs to be remembered that, when the child process stops, its parent process is suspended, and that the child borrows the parent’s memory and thread of control until a call to exec*() or an exit (either by a call to exit() or abnormally (see exec(2) and exit(2))).
ptrace(2) ptrace(2) typedef struct ptrace_state{ events_t pe_report_event; int pe_path_len; pid_t pe_other_pid; } ptrace_state_t; The event that the traced process responded to and stopped is logged in the pe_report_event member. One of PTRACE_EXEC , PTRACE_EXIT , PTRACE_FORK , PTRACE_SIGNAL , or PTRACE_VFORK is logged here. See the definition of events_t in for more details.
ptrace(2) ptrace(2) printf("Child: exec failed\n"); exit(0); } parent() { close(filed[0]); /* Before child does an exec, attach it and set its event flag. */ if (ptrace(PT_ATTACH,pid)) /* failed to attach process */ printf("Parent: Failed to attach child\n"); if (pid != wait(&status)) /* wait failed */ printf("Parent: attach failed with wrong wait status\n"); if (!WIFSTOPPED(status) || (WSTOPSIG(status) != SIGTRAP)) printf("Parent: SIGTRAP didn’t stop child\n"); /* * The child process has now stopped.
ptrace(2) ptrace(2) main() { event_len = sizeof(ptrace_event_t); state_len = sizeof(ptrace_state_t); event_addr = calloc(event_len, 1); state_addr = calloc(state_len, 1); buf_addr = calloc(MAXPATH, 1); pipe(filed); switch (pid = fork()) { case -1: exit(1); case 0: child(); break; default: parent(); break; } } ERRORS If ptrace() fails, errno is set to one of the following values. p [EACCES] The executable image of the process being attached resides across an interruptible NFS mount.
putmsg(2) putmsg(2) NAME putmsg, putpmsg - send a message on a stream SYNOPSIS #include int putmsg( int fildes, struct strbuf *ctlptr, struct strbuf *dataptr, int flags ); int putpmsg( int fildes, struct strbuf *ctlptr, struct strbuf *dataptr, int band, int flags ); DESCRIPTION The putmsg() function creates a message from a process buffer(s) and sends the message to a STREAMS file. The message may contain either a data part, a control part, or both.
putmsg(2) putmsg(2) RETURN VALUE Upon successful completion, putmsg() and putpmsg() return 0. Otherwise, they return -1 and set errno to indicate the error. ERRORS [EAGAIN] A non-priority message was specified, the O_NONBLOCK flag is set, and the stream write queue is full due to internal flow control conditions, or buffers could not be allocated for the message that was to be created. [EBADF] fildes is not a valid file descriptor open for writing.
quotactl(2) quotactl(2) NAME quotactl - manipulate disk quotas SYNOPSIS #include int quotactl(int cmd, const char *special, uid_t uid, void *addr); DESCRIPTION quotactl() manipulates disk quotas. cmd indicates a command to be applied to the user ID uid. Parameter special is a pointer to a null-terminated string containing the path name of the block special device for the file system being manipulated. The block special device must be mounted.
quotactl(2) quotactl(2) [EDQUOT] User’s disk quota block limit has been reached for this file system. WARNINGS The quotactl() system call is incompatible with the 4.2/4.3BSD implementation of Melbourne quotas which uses a different system call interface and on-disk data structure. AUTHOR quotactl() was developed by HP and Sun Microsystems, Inc. SEE ALSO quota(1), edquota(1M), rquotad(1M), quotacheck(1M), quotaon(1M), mount(2), quota(5), quota(5).
read(2) read(2) NAME read, readv, pread - read from file SYNOPSIS #include ssize_t read(int fildes, void *buf, size_t nbyte); ssize_t pread(int fildes, void *buf, size_t nbyte, off_t offset); #include ssize_t readv(int fildes, const struct iovec *iov, int iovcnt); DESCRIPTION The read() function attempts to read nbyte bytes from the file associated with the open file descriptor, fildes, into the buffer pointed to by buf.
read(2) read(2) byte-stream mode, read() retrieves data from the STREAM until as many bytes as were requested are transferred, or until there is no more data to be retrieved. Byte-stream mode ignores message boundaries. In STREAMS message-nondiscard mode, read() retrieves data until as many bytes as were requested are transferred, or until a message boundary is reached.
read(2) read(2) [EINVAL] The STREAM or multiplexer referenced by fildes is linked (directly or indirectly) downstream from a multiplexer. [EIO] A physical I/O error has occurred. [EIO] The process is a member of a background process attempting to read from its controlling terminal, the process is ignoring or blocking the SIGTTIN signal or the process group is orphaned. This error may also be generated for implementation-dependent reasons.
read(2) read(2) • The APPLICATION USAGE section is removed. • The description of [EINTR] is amended. Issue 4, Version 2 The following changes are incorporated for X/OPEN UNIX conformance: • The readv() function is added to the SYNOPSIS. • The DESCRIPTION is updated to describe the reading of data from STREAMS files. An operational description of the readv() function is also added. • References to the readv() function are added to the RETURN VALUE and ERRORS sections in appropriate places.
read(2) read(2) HP-UX EXTENSIONS DESCRIPTION For readv() , the iovec structure is defined in /usr/include/sys/uio.h. For ordinary files, if the O_RSYNC |O_DSYNC file status flag is set, the calling process blocks until the data being read and all file attributes required to retrieve the data are the same as their image on disk. Writes pending on the data to be read are executed before returning to the calling process.
read(2) read(2) [ENOLCK] The system record lock table is full, preventing the read from sleeping until the blocking write lock is removed. In addition, readv() can return one of the following errors: [EFAULT] iov_base or iov points outside of the allocated address space. The reliable detection of this error is implementation-dependent.
readlink(2) readlink(2) NAME readlink() - read the contents of a symbolic link SYNOPSIS #include int readlink( const char *path, char *buf, size_t bufsiz ); DESCRIPTION The readlink() function places the contents of the symbolic link referred to by path in the buffer buf which has size bufsiz. If the number of bytes in the symbolic link is less than bufsiz, the contents of the remainder of buf are unspecified.
readlink(2) readlink(2) HP-UX EXTENSIONS SYNOPSIS #include DESCRIPTION If the length of the path name string is less than bufsiz, the string will be null-terminated when returned. If the length of the path name string is exactly bufsiz, the string will not be null-terminated when returned. ERRORS [EACCES] Search permission is denied for a component of the path prefix. [EFAULT] buf or path points outside the process’s allocated address space.
reboot(2) reboot(2) NAME reboot - boot the system SYNOPSIS #include int reboot (int howto); DESCRIPTION reboot() causes the system to reboot. howto is a mask of reboot options (see ), specified as follows: RB_AUTOBOOT A file system sync is performed (unless RB_NOSYNC is set) and the processor is rebooted from the default device and file. RB_HALT The processor is simply halted. A sync of the file system is performed unless the RB_NOSYNC flag is set.
recv(2) recv(2) NAME recv, recvfrom, recvmsg - receive a message from a socket SYNOPSIS #include
recv(2) recv(2) the user as soon as it becomes available, and no data is discarded. See the AF_CCITT Only subsection below for a list of the exceptions to this behavior for connections in the address family AF_CCITT. recvmsg() performs the same action as recv() , but scatters the read data into the buffers specified in the msghdr structure (see _XOPEN_SOURCE_EXTENDED Only below). This structure is defined in
recv(2) recv(2) • If the the remote side of a connection-based socket has reset the connection, recv() returns −1 and sets errno to [ECONNRESET]. • If an error occurs, recv() returns −1 and errno is set to indicate the error. If the O_NDELAY flag is set using fcntl() (defined in and explained in fcntl(2) and fcntl(5)), nonblocking I/O is enabled.
recv(2) recv(2) • The MSG_PEEK flag is supported; the two flags can be combined. • If a message is received that is larger than the user-controlled maximum message size, the X.25 subsystem RESETs the circuit, discards the data, and sends the out-of-band event OOB_VC_MESSAGE_TOO_BIG to the socket.
recv(2) recv(2) The flags parameter accepts a new value, MSG_WAITALL , which requests that the function block until the full amount of data requested can be returned. The function may return a smaller amount of data if a signal is caught, the connection is terminated, or an error is pending for the socket. On successful completion of recvmsg() , the msg_flags member of the message header is the bitwiseinclusive OR of all of the following flags that indicate conditions detected for the received message.
recv(2) recv(2) [ENOTSOCK] The argument s is a valid file descriptor, but it is not a socket. [EOPNOTSUPP] The MSG_OOB flag was set for a UDP SOCK_DGRAM message-based socket, or MSG_OOB or MSG_PEEK was set for any AF_UNIX socket. The MSG_OOB flag is supported only for stream-based TCP SOCK_STREAM sockets. Neither MSG_PEEK nor MSG_OOB is supported for AF_UNIX sockets. AF_CCITT only: recv() was issued on a listen() socket.
regctl(2) regctl(2) NAME regctl() - privileged register control SYNOPSIS #include int regctl(regctl_request_t request, unsigned int register, int64_t val, uint64_t *retval); Remarks Much of the functionality of this capability is highly dependent on underlying hardware. An application that uses this system call should not be expected to be portable across architectures or implementations.
regctl(2) regctl(2) RETURN VALUE regctl() returns zero on successful completion, and -1 on failure. ERRORS In general, regctl() fails if one or more of the following is true: [EPERM] Calling process is not registered as a real-time application. [ETIMEDOUT] RTE_PA_POLL_EIRR timed out after checking EIRR for specified count. [EFAULT] location specified by retval is not in memory and a trap has occurred. [EINVAL] request is an illegal number or register is invalid for control register access requests.
rename(2) rename(2) NAME rename - change the name of a file SYNOPSIS #include int rename(const char *source, const char *target); DESCRIPTION The rename() system call causes the source file to be renamed to target. If target exists, it is first removed. Both source and target must be of the same type (that is, either directories or nondirectories), and must reside on the same file system.
rename(2) rename(2) AUTHOR rename() was developed by the University of California, Berkeley. SEE ALSO open(2), thread_safety(5). STANDARDS CONFORMANCE rename() : AES, SVID3, XPG3, XPG4, FIPS 151-2, POSIX.
rmdir(2) rmdir(2) NAME rmdir() - remove a directory file SYNOPSIS #include int rmdir(const char *path); DESCRIPTION The rmdir() system call removes a directory file whose name is given by path. The directory must be empty (except for the files . and .. ) before it can be removed. RETURN VALUE rmdir() returns the following values: 0 Successful completion. -1 Failure. errno is set to indicate the error. ERRORS If rmdir() fails, errno is set to one of the following values.
rtprio(2) rtprio(2) NAME rtprio - change or read real-time priority SYNOPSIS #include int rtprio(pid_t pid, int prio); DESCRIPTION The rtprio() system call sets or reads the real-time priority of a process. If pid is zero, it specifies the calling process; otherwise, it specifies the process ID of a process.
rtprio(2) rtprio(2) indicated by pid. [EPERM] The group access list of the calling process does not contain a group having prio is not RTPRIO_NOCHG , or PRIV_RTPRIO capability and RTPRIO_RTOFF with a pid of zero. [ESRCH] No process can be found corresponding to that specified by pid.
rtsched(2) rtsched(2) NAME rtsched: sched_get_priority_max(), sched_get_priority_min(), sched_getparam(), sched_getscheduler(), sched_rr_get_interval(), sched_setparam(), sched_setscheduler(), sched_yield(), PRI_HPUX_TO_POSIX(), PRI_POSIX_TO_HPUX() - real-time scheduling operations SYNOPSIS #include
rtsched(2) rtsched(2) member in the param structure is any integer within the inclusive priority range for the current scheduling policy of the process specified by pid. Higher numerical values for the priority represent higher (stronger) priorities. Note that this is different from the SCHED_HPUX , SCHED_TIMESHARE, SCHED_NOAGE , and SCHED_RTPRIO scheduling policies, where higher numerical values represent lower (weaker) priorities.
rtsched(2) rtsched(2) Note: If the target process is multi-threaded, this change will only affect a child process that is created later and inherits its parent’s scheduling policy and priority. The priority returned is the old priority of the target process, though individual threads or lightweight processes may have a different value if some other interface is used to change an individual thread or lightweight process’ priority.
rtsched(2) rtsched(2) Each process will be controlled by an associated scheduling policy and priority. These parameters may be specified by explicit application execution of the sched_setscheduler() or sched_setparam() functions. Associated with each policy is a priority range. The priority ranges for each policy can (but need not) overlap the priority ranges of other policies. When a process is to be selected to run, the process that is at the head of the highest priority nonempty process list is chosen.
rtsched(2) rtsched(2) SCHED_RR is provided as the parameter. The priority range for this policy contains at least 32 priorities. SCHED_RR2 Round-robin scheduling policy, with a per-priority time slice (time quantum). This policy is identical to the SCHED_RR policy, except that the round-robin time slice interval returned by sched_rr_get_interval() depends upon the priority of the specified process.
rtsched(2) rtsched(2) The threads in different processor sets do not compete with one another for processors based on their scheduling policy and priority values. The scheduler looks only at threads assigned to a processor’s processor set to choose the next thread to run. A process with lower scheduling priority in one processor set may be executing while another process in another processor set with higher scheduling priority is waiting for the processor resources.
rtsched(2) rtsched(2) [ENOSYS] The function is not supported by this implementation. [EPERM] The requesting process does not have permission to set the scheduling policy of the specified process. [ESRCH] No process can be found corresponding to that specified by pid. sched_getscheduler() [ENOSYS] The function is not supported by this implementation. [ESRCH] sched_yield() [ENOSYS] No process can be found corresponding to that specified by pid. The function is not supported by this implementation.
select(2) select(2) NAME select - synchronous I/O multiplexing SYNOPSIS #include int select(int nfds, fd_set *readfds, *errorfds, struct timeval *timeout); 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); fd_set *writefds, fd_set DESCRIPTION The select() function indicates which of the specified file descriptors is ready for reading, ready for writing, or has an error condition pending.
select(2) select(2) On failure, the objects pointed to by the readfds, writefds, and errorfds arguments are not modified. If the timeout interval expires without the specified condition being true for any of the specified file descriptors, the objects pointed to by the readfds, writefds, and errorfds arguments have all bits set to 0. File descriptor masks of type fd_set can be initialized and tested with FD_CLR() , FD_ISSET() , FD_SET() , and FD_ZERO() .
select(2) select(2) /* * Set num_of_fds to the required value. * User can set it to the maximum possible value the kernel is * configured for, by using sysconf(_SC_OPEN_MAX). * Note that, if you are not using these many files, you are * wasting too much space. */ num_of_fds = sysconf(_SC_OPEN_MAX); s = sizeof(long); /* * howmany is a macro defined in sys/types.h */ f = (struct fd_set *)malloc(s*howmany(num_of_fds, s*8); /* * Use f wherever struct fd_set * is used.
select(2) select(2) HP-UX EXTENSIONS SYNOPSIS #include int select( size_t nfds, int *readfds, int *writefds, int *exceptfds, const struct timeval *timeout ); DESCRIPTION This select() function prototype is provided for backward compatibility only. For this prototype to be used, , instead of , must be included and the symbol _XOPEN_SOURCE_EXTENDED must not be defined in the compilation time. Otherwise, the X/Open compliant version will be used.
select(2) select(2) * for opening the terminals is not shown here. */ for (i=0; i < NTTYS; i++) { ttymask[i] = MASK(tty[i]); readmask |= ttymask[i]; } timeout.tv_sec = 5; timeout.
select(2) select(2) printf ("select timed out \n"); else for (i=0, k=0; i < NTTYS && k < NWORDS; k++) for (j=0; j < NFDBITS && i < NTTYS; j++, i++) if (ttymask[i] & readfds.fds_bits[k]) /* Read from tty[i]. The code for reading * is not shown here. */ else printf ("tty[%d] is not ready for reading \n",i); WARNINGS Check all references to signal(5) for appropriateness on systems that support sigvector() . sigvector() can affect the behavior described on this manpage.
sem_close(2) sem_close(2) NAME sem_close - close a named POSIX semaphore SYNOPSIS #include int sem_close(sem_t *sem); DESCRIPTION sem_close() is used to close a named semaphore. A successful call to sem_close() will do the following: Remove the process’s descriptor for the semaphore referenced by the specified sem_t structure sem.
sem_destroy(2) sem_destroy(2) NAME sem_destroy - destroy an unnamed POSIX semaphore SYNOPSIS #include int sem_destroy(sem_t *sem); DESCRIPTION sem_destroy() is used to destroy an unnamed semaphore. A successful call to sem_destroy() will invalidate the unnamed semaphore referred to by sem and removes all descriptors referencing it. The semaphore should have been created by a previous call to sem_init() and there should not be any processes blocked on it.
sem_getvalue(2) sem_getvalue(2) NAME sem_getvalue - get the value of a POSIX semaphore SYNOPSIS #include int sem_getvalue(sem_t *sem, int *sval); DESCRIPTION sem_getvalue() is used to read the value of the semaphore. The value of the semaphore specified by sem is read, at some unspecified time during the call, and then stored into sval. If the semaphore value is <= 0, at that time, the semaphore is considered unavailable.
sem_init(2) sem_init(2) NAME sem_init - initialize an unnamed POSIX semaphore SYNOPSIS #include int sem_init(sem_t *sem, int pshared, unsigned int value); DESCRIPTION sem_init() is used to initialize an unnamed semaphore. A successful call to sem_init() will create a new unnamed semaphore referred to by sem, if one does not exist, initialize the unnamed semaphore descriptor, referred to by sem, to the non-negative value specified by value. If the unnamed semaphore already exists, i.e.
sem_open(2) sem_open(2) NAME sem_open - create/open a named POSIX semaphore SYNOPSIS #include sem_t * sem_open(const char *name, int oflag, mode_t mode, unsigned int value); DESCRIPTION sem_open() is used to open or create a named semaphore. A successful call to sem_open() will create a descriptor for the semaphore specified by name. The pointer to the semaphore returned by sem_open() can be used to access the semaphore associated with name in subsequent operations.
sem_open(2) sem_open(2) [ENFILE] There are too many semaphores in the system. [ENOENT] The flag O_CREAT is not set in oflag and the named semaphore does not exist. [ENOSPC] There are insufficient resources for the creation of a new named semaphore. SEE ALSO sem_close(2), sem_post(2), sem_wait(2), sem_unlink(2), .
sem_post(2) sem_post(2) NAME sem_post - unlock a POSIX semaphore SYNOPSIS #include int sem_post(sem_t *sem); DESCRIPTION sem_post() is used to post the semaphore referenced by sem. The calling thread will not return from its call to sem_post() unless it can either: increment the semaphore value, if there are no blocked threads on this semaphore; give the semaphore to a blocked thread, if there are any blocked threads on this semaphore; or have an error condition.
sem_unlink(2) sem_unlink(2) NAME sem_unlink - unlink a named POSIX semaphore SYNOPSIS #include int sem_unlink(const char *name); DESCRIPTION sem_unlink() is used to unlink named semaphores. A successful call to sem_unlink() marks the semaphore, specified by name, for removal. Calling sem_unlink() does not affect processes, including the calling process, which currently have a descriptor, obtained from a call to sem_open() . Named semaphores are uniquely identified by character strings.
sem_wait(2) sem_wait(2) NAME sem_wait, sem_trywait - lock a POSIX semaphore SYNOPSIS #include int sem_wait(sem_t *sem); int sem_trywait(sem_t *sem); DESCRIPTION sem_wait() is used to lock a semaphore. The calling thread will not return from its call to sem_wait() until one of the following events occur: it successfully obtains a lock on the semaphore; it is interrupted by a signal or an error condition occurs. sem_trywait() is used to lock a semaphore, if it is available.
semctl(2) semctl(2) NAME semctl - semaphore control operations SYNOPSIS #include int semctl(int semid, int semnum, int cmd, union arg ); union semun { int val; struct semid_ds ∗buf; ushort ∗array; } arg; DESCRIPTION The semctl() system call provides a variety of semaphore control operations as specified by cmd. For the meaning of unspecified variables, see semaphore identifier in glossary(9).
semctl(2) semctl(2) associated with semid. RETURN VALUE Upon successful completion, semctl() returns a value based on cmd as follows: GETVAL GETNCNT GETZCNT GETPID The value of The value of The value of The value of semval. semncnt. semzcnt. sempid. All others return 0. If it fails, it returns -1 and sets errno to indicate the error.
semget(2) semget(2) NAME semget - get set of semaphores SYNOPSIS #include int semget(key_t key, int nsems, int semflg); DESCRIPTION semget() returns the semaphore identifier associated with key. A semaphore identifier and associated data structure and set containing nsems semaphores are created for key if one of the following is true: key is equal to IPC_PRIVATE . This call creates a new identifier, subject to available resources.
semget(2) semget(2) [EEXIST] A semaphore identifier exists for key but (( semflg & IPC_CREAT) && (semflg & IPC_EXCL)) is ‘‘true’’. SEE ALSO ipcrm(1), ipcs(1), semctl(2), semop(2), stdipc(3C).
semop(2) semop(2) NAME semop - semaphore operations SYNOPSIS #include int semop( int semid, struct sembuf *sops, size_t nsops ); DESCRIPTION semop() is used to atomically perform an array of semaphore operations on the set of semaphores associated with the semaphore identifier specified by semid. sops is a pointer to the array of semaphoreoperation structures. nsops is the number of such structures in the array.
semop(2) semop(2) calling process until one of the following occurs: semval becomes zero, at which time the value of semzcnt associated with the specified semaphore is decremented. The semid for which the calling process is awaiting action is removed from the system. When this occurs, errno is set equal to EIDRM, and a value of −1 is returned. The calling process receives a signal that is to be caught.
semop(2) semop(2) WARNINGS Check all references to signal(5) for appropriateness on systems that support sigvector (2). sigvector (2) can affect the behavior described on this page. SEE ALSO ipcs(1), exec(2), exit(2), fork(2), semctl(2), semget(2), stdipc(3C), signal(5), thread_safety(5).
send(2) send(2) NAME send(), sendmsg(), sendto() - send a message from a socket SYNOPSIS #include
send(2) send(2) returned, and errno is set to [EMSGSIZE]. For SOCK_DGRAM sockets, this size is fixed by the implementation (see the DEPENDENCIES section). Otherwise there is no size limit. When send() or sendto() returns a positive value, it only indicates this number of bytes have been sent to the local transport provider. It does not mean this number of bytes have been delivered to the peer socket application. A SOCK_DGRAM socket does not guarantee end-to-end delivery.
send(2) send(2) If the O_NDELAY flag is set using fcntl() (defined in and explained in fcntl(2) and fcntl(5)), nonblocking I/O is enabled. In this case, the send() request completes in one of three ways: • If there is enough space available in the system to buffer all of the data, send() completes successfully, having written out all of the data, and returns the number of bytes written.
send(2) send(2) void socklen_t int *msg_control; msg_controllen; msg_flags; /* ancillary data, see below */ /* ancillary data buffer len */ /* flags on received message */ } Obsolescent (UNIX 95) struct msghdr { void *msg_name; size_t msg_namelen; struct iovec *msg_iov; int msg_iovlen; void *msg_control; size_t msg_controllen; int msg_flags; } /* /* /* /* /* /* /* optional address */ size of address */ scatter array for data */ # of elements in msg_iov */ ancillary data, see below */ ancillary data b
send(2) send(2) asynchronously. An asynchronous error can be caused by a gateway failing to forward a datagram from this socket because the datagram exceeds the MTU of the next-hop network and the "Don’t Fragment" (DF) bit in the datagram is set. (See SO_PMTU in getsockopt(2)). [EBADF] s is not a valid file descriptor. [ECONNRESET] A connection was forcibly closed by a peer. [EDESTADDRREQ] The to parameter needs to specify a destination address for the message.
send(2) send(2) has been shut down either by the remote peer or by this side of the connection. Note that the default action for SIGPIPE , unless the process has established a signal handler for this signal, is to terminate the process. [EWOULDBLOCK] Nonblocking I/O is enabled using ioctl() FIOSNBIO request and the requested operation would block. DEPENDENCIES UDP messages are fragmented at the IP level into Maximum Transmission Unit (MTU) sized pieces; MTU varies for different link types.
sendfile(2) sendfile(2) NAME sendfile() - send the contents of a file through a socket SYNOPSIS #include sbsize_t sendfile(int s, int fd, off_t offset, bsize_t nbytes, const struct iovec *hdtrl, int flags); DESCRIPTION The sendfile() system call transmits the contents of a file associated with the file descriptor fd, plus an optional header and trailer buffers across a socket connection specified by s. sendfile() can be used only when the socket is in a connected state.
sendfile(2) sendfile(2) [EAGAIN] Nonblocking I/O is enabled using the O_NONBLOCK flag with fcntl() , and the requested operation would block. [EWOULDBLOCK] The socket is marked non-blocking and the requested operation would block. [ENOMEM] No memory is available in the system to perform the operation. [EOPNOTSUPP] The socket is not a TCP socket.
sendfile64(2) sendfile64(2) NAME sendfile64() - send the contents of a Large File through a socket SYNOPSIS #include sbsize64_t sendfile64(int s, int fd, off64_t offset, bsize64_t nbytes, const struct iovec *hdtrl, int flags); DESCRIPTION The sendfile64() system call transmits the contents of a file (including a Large File (greater than 2GB)) associated with the file descriptor fd, plus an optional header and trailer buffers across a socket connection specified by s.
sendfile64(2) sendfile64(2) connected to its peer. [EPIPE] With SIGPIPE signal. An attempt was made to send on a socket that was connected, but the connection has been shut down either by the remote peer or by this side of the connection. Note that the default action for SIGPIPE , unless the process has established a signal handler for this signal, is to terminate the process. [EAGAIN] Nonblocking I/O is enabled using the O_NONBLOCK flag with fcntl() , and the requested operation would block.
serialize(2) serialize(2) NAME serialize() - force target process to run serially with other processes SYNOPSIS #include int serialize(int timeshare, pid_t pid); DESCRIPTION The serialize() system call is used to force the target process referenced by the pid value passed in to run serially with other processes also marked for serialization. If the value of pid is zero, then the currently running process is marked for serialization.
setacl(2) setacl(2) NAME setacl, fsetacl - set access control list (ACL) information SYNOPSIS #include int setacl( const char *path, int nentries, const struct acl_entry *acl ); int fsetacl( int fildes, int nentries, const struct acl_entry *acl ); DESCRIPTION setacl() sets an existing file’s access control list (ACL) or deletes optional entries from it. path points to a path name of a file.
setacl(2) setacl(2) Altering a base ACL entry’s modes with setacl() changes the file’s corresponding permission bits. The permission bits can be altered also by using chmod() (see chmod(2)) and read using stat() (see stat(2)). The number of entries allowed per file (see NACLENTRIES in ) is small for space and performance reasons. User groups should be created as needed for access control purposes.
setacl(2) setacl(2) acl [1] . uid = 103; acl [1] . gid = 204; acl [1] . mode = R_OK; if (setacl (filename, 2, acl)) error (...); The following call deletes all optional ACL entries from file1 : setacl ("file1", ACL_DELOPT, (struct acl_entry *) 0); DEPENDENCIES NFS setacl() and fsetacl() are not supported on remote files. HFS ACLs are only supported on HFS file systems. AUTHOR setacl() and fsetacl() were developed by HP. SEE ALSO access(2), chmod(2), getaccess(2), getacl(2), stat(2), acl(5), unistd(5).
setaudid(2) setaudid(2) NAME setaudid - set the audit ID (aid) for the current process SYNOPSIS #include int setaudid(aid_t audid); DESCRIPTION setaudid() sets the audit ID (aid) for the current process. This call is restricted to the super-user. RETURN VALUE Upon successful completion, setaudid() returns a value of 0; otherwise, it returns −1 and sets errno to indicate the error.
setaudproc(2) setaudproc(2) NAME setaudproc - controls process level auditing for the current process and its decendents SYNOPSIS #include int setaudproc(int aflag); DESCRIPTION setaudproc() controls process level auditing for the current process and its decendents. It accomplishes this by setting or clearing the u_audproc flag in the u area of the calling process. When this flag is set, the system audits the process; when it is cleared, the process is not audited.
setevent(2) setevent(2) NAME setevent - set current events and system calls which are to be audited SYNOPSIS #include int setevent( const struct aud_type a_syscall[], const struct aud_event_tbl a_event[] ); DESCRIPTION setevent() sets the events and system calls to be audited. The event and system call settings in the tables pointed to by a_syscall and a_event become the current settings. This call is restricted to the superuser.
setgroups(2) setgroups(2) NAME setgroups - set group access list SYNOPSIS #include int setgroups(int ngroups, const gid_t *gidset); DESCRIPTION setgroups() sets the group access list of the current user process according to the array gidset. The parameter ngroups indicates the number of entries in the array and must be no more than NGROUPS_MAX , as defined in .
sethostname(2) sethostname(2) NAME sethostname - set name of host cpu SYNOPSIS #include int sethostname(const char *name, size_t namelen); DESCRIPTION The sethostname() system call sets the name of the host processor to name, which has a length of namelen characters. At system boot time sethostname() is normally executed by the hostname command (see hostname(1)) in the /sbin/init.d/hostname script. Host names are limited to MAXHOSTNAMELEN characters, as defined in .
setpgid(2) setpgid(2) NAME setpgid(), setpgrp2() - set process group ID for job control SYNOPSIS #include int setpgid(pid_t pid, pid_t pgid); int setpgrp2(pid_t pid, pid_t pgid); DESCRIPTION The setpgid() and setpgrp2() system calls cause the process specified by pid to join an existing process group or create a new process group within the session of the calling process. The process group ID of the process whose process ID is pid is set to pgid.
setpgrp(2) setpgrp(2) NAME setpgrp - set process group ID SYNOPSIS #include pid_t setpgrp(void); DESCRIPTION If the calling process is not already a session leader, setpgrp() sets the process group ID of the calling process to the process ID of the calling process. If setpgrp() creates a new session, then the new session has no controlling terminal. The setpgrp() function has no effect when the calling process is a session leader.
setpgrp3(2) setpgrp3(2) (TO BE OBSOLETED) NAME setpgrp3 - create session and set process group ID; for HP-UX 9.x compatibility. SYNOPSIS #include pid_t setpgrp3(void); DESCRIPTION If the calling process is not a process group leader, setpgrp3() creates a new session. The calling process becomes the session leader of this new session, it becomes the process group leader of a new process group, and it has no controlling terminal.
setresuid(2) setresuid(2) NAME setresuid, setresgid - set real, effective, and saved user and group IDs SYNOPSIS #include int setresuid(uid_t ruid, uid_t euid, uid_t suid); int setresgid(gid_t rgid, gid_t egid, gid_t sgid); DESCRIPTION setresuid() sets the real, effective and/or saved user ID of the calling process.
setreuid(2) setreuid(2) NAME setreuid - set real and effective user IDs SYNOPSIS #include int setreuid(uid_t ruid, uid_t euid); DESCRIPTION The setreuid() function sets the real and effective user IDs of the current process to the values specified by the ruid and euid arguments. If ruid or euid is −1, the corresponding effective or real user ID of the current process is left unchanged. A process with appropriate privileges can set either ID to any value.
setsid(2) setsid(2) NAME setsid - create session and set process group ID SYNOPSIS #include pid_t setsid(void); DESCRIPTION If the calling process is not a process group leader, setsid() creates a new session. The calling process becomes the session leader of this new session, it becomes the process group leader of a new process group, and it has no controlling terminal. The process group ID of the calling process is set equal to the process ID of the calling process.
settune(2) settune(2) NAME settune - set the value of a kernel tunable parameter SYNOPSIS #include int settune(const char *tunable, uint64_t value, unsigned int flags); DESCRIPTION This function sets the value of the kernel tunable parameter named tunable to the supplied value. This new value will take effect immediately, except in the cases noted below. Some parameters cannot be changed without rebuilding the OS kernel, and then booting that rebuilt kernel.
settune(2) settune(2) [EINVAL] The specified value is not within the acceptable range for the specified parameter. [EBUSY] The value of the parameter could not be changed immediately. [ENOTSUP] The specified parameter cannot be changed without rebuilding the kernel. [EIO] The Kernel Registry Service was unavailable or encountered an error. [ENOMEM] Insufficient memory to accommodate the new parameter value.
setuid(2) setuid(2) NAME setuid, setgid - set user and group IDs SYNOPSIS #include int setuid(uid_t uid); int setgid(gid_t gid); DESCRIPTION setuid() sets the real-user-ID (ruid), effective-user-ID (euid), and/or saved-user-ID (suid) of the calling process. The super-user’s euid is zero. The following conditions govern setuid’s behavior: • If the euid is zero, setuid() sets the ruid, euid, and suid to uid.
shm_open(2) shm_open(2) NAME shm_open - create/open a shared memory object SYNOPSIS #include int shm_open(const char *name, int oflag, mode_t mode); DESCRIPTION The shm_open() system call establishes a connection between a shared memory object and a file descriptor. It creates an open file description that corresponds to the shared memory object and returns a file descriptor that refers to that open file description.
shm_open(2) [EMFILE] shm_open(2) Too many file descriptors are currently in use by this process. [ENAMETOOLONG] The length of the name string exceeds PATH_MAX , or the length of a (pathname) component of the name string exceeds NAME_MAX while _POSIX_NO_TRUNC is in effect. [ENFILE] Too many shared memory objects are currently open in the system. [ENOENT] The O_CREAT flag is not set in oflag and the named shared memory object does not exist.
shm_unlink(2) shm_unlink(2) NAME shm_unlink - unlink a shared memory object SYNOPSIS #include int shm_unlink(const char *name); DESCRIPTION The shm_unlink() system call removes the name of the shared memory object named by the string pointed to by name.
shmctl(2) shmctl(2) NAME shmctl() - shared memory control operations SYNOPSIS #include int shmctl(int shmid, int cmd, struct shmid_ds *buf); DESCRIPTION The shmctl() system call provides a variety of shared memory control operations as specified by the cmd argument. cmd can have the following values: IPC_STAT Place the current value of each member of the data structure associated with shmid into the structure pointed to by buf. The contents of this structure are defined in glossary(9).
shmctl(2) shmctl(2) [EINVAL] cmd is not a valid command, or the command contains invalid parameters. [ENOMEM] cmd is equal to SHM_LOCK and there is not sufficient lockable memory to fill the request. [EPERM] cmd is equal to IPC_RMID , IPC_SET , SHM_LOCK , or SHM_UNLOCK and the effective user ID of the calling process is not equal to that of a user having appropriate privileges and it is not equal to the value of either shm_perm.uid or shm_perm.cuid in the data structure associated with shmid.
shmget(2) shmget(2) NAME shmget - get shared memory segment SYNOPSIS #include int shmget(key_t key, size_t size, int shmflg); DESCRIPTION shmget() returns the shared memory identifier associated with key. A shared memory identifier and associated data structure and shared memory segment of size size bytes (see glossary(9)) are created for key if one of the following is true: • • key is equal to IPC_PRIVATE . This call creates a new identifier, subject to available resources.
shmget(2) shmget(2) [EINVAL] A shared memory identifier exists for key but is in 64-bit address space and the process performing the request has been compiled as a 32-bit executable. In order to avoid receiving this error, both IPC_SHARE32 and IPC_CREAT must be set in shmflg by the 64-bit processes upon segment creation. [EACCES] A shared memory identifier exists for key but operation permission (see glossary(9)) as specified by the low-order 9 bits of shmflg would not be granted.
shmop(2) shmop(2) NAME shmat(), shmdt() - shared memory operations SYNOPSIS #include void *shmat(int shmid, void *shmaddr, int shmflg); int shmdt(void *shmaddr); DESCRIPTION shmat() attaches the shared memory segment associated with the shared memory identifier specified by shmid to the data segment of the calling process. The segment is attached for reading if (shmflg & SHM_RDONLY ) is "true"; otherwise, it is attached for reading and writing.
shmop(2) shmop(2) [EINVAL] shmaddr is not the data segment start address of a shared memory segment. EXAMPLES The following call to shmat() attaches the shared memory segment to the process. This example assumes the process has a valid shmid, which can be obtained by calling shmget(2). char *shmptr; shmptr = (char *) shmat(myshmid, 0, 0); The following call to shmdt() then detaches the shared memory segment. shmdt (shmptr); SEE ALSO ipcs(1), exec(2), exit(2), fork(2), ftok(3C), shmctl(2), shmget(2).
shutdown(2) shutdown(2) NAME shutdown - shut down a socket SYNOPSIS #include int shutdown(int s, int how); DESCRIPTION The shutdown() system call is used to shut down a socket. In the case of a full-duplex connection, shutdown() can be used to either partially or fully shut down the socket, depending upon the value of how.
shutdown(2) [EINVAL] shutdown(2) HP-UX BSD Sockets only. The specified socket is not connected. [ENOTCONN] _XOPEN_SOURCE_EXTENDED only. The specified socket is not connected. [EINVAL] _XOPEN_SOURCE_EXTENDED only. The how argument is invalid. WARNINS Currently, the default behavior is the HP-UX BSD Sockets; however, it might be changed to X/Open Sockets in a future release. At that time, any HP-UX BSD Sockets behavior that is incompatible with X/Open Sockets might be obsoleted.
sigaction(2) sigaction(2) NAME sigaction - examine and change signal action SYNOPSIS #include int sigaction ( int sig, const struct sigaction *act, struct sigaction *oact ); DESCRIPTION The sigaction() function allows the calling process to examine and/or specify the action to be associated with a specific signal. The argument sig specifies the signal; acceptable values are defined in .
sigaction(2) sigaction(2) interruptible functions interrupted by this signal will fail with errno set to [EINTR]. SA_SIGINFO If cleared and the signal is caught, the signal-catching function will be entered as: void func(int signo); where signo is the only argument to the signal catching function. In this case the sa_handler member must be used to describe the signal catching function and the application must not modify the sa_sigaction member.
sigaction(2) sigaction(2) SA_RESETHAND is set, and then including the signal being delivered. If and when the user’s signal handler returns normally, the original signal mask is restored. Once an action is installed for a specific signal, it remains installed until another action is explicitly requested (by another call to sigaction() ), until the SA_RESETHAND flag causes resetting of the handler, or until one of the exec functions is called.
sigaction(2) sigaction(2) If, when a pending signal is delivered, there are additional signals to be queued to that signal number, the signal will remain pending. Otherwise, the pending indication will be reset. An implementation will document any condition not specified by this document under which the implementation generates signals. Signal Actions There are three types of action that can be associated with a signal: SIG_DFL , SIG_IGN or a pointer to a function.
sigaction(2) sigaction(2) • The behaviour of a process is undefined after it returns normally from a signal- catching function for a SIGBUS , SIGFPE , SIGILL , or SIGSEGV signal that was not generated by kill() or raise() . • The system will not allow a process to catch the signals SIGKILL and SIGSTOP .
sigaction(2) sigaction(2) shared data structures. Note in particular that even the "safe" functions may modify the global variable errno ; the signal-catching function may want to save and restore its value. Naturally, the same principles apply to the reentrancy of application routines and asynchronous data access. Note that longjmp() and siglongjmp() are not in the list of reentrant functions.
sigaction(2) sigaction(2) • The type of argument act is changed from struct sigaction * to const struct sigaction *. • A statement is added to the DESCRIPTION section indicating that the consequence of attempting to set SIG_DFL for a signal that cannot be caught or ignored is unspecified. The [EINVAL] error, describing one possible reaction to this condition, is added to the ERRORS section.
sigaction(2) sigaction(2) HP-UX EXTENSIONS DESCRIPTION More details on the semantics of specific signals can be found in the signal(5) manual entry. SIG_DFL Upon receipt of the signal sig, the default action (specified on signal(5)) is performed. [EFAULT] act or oact points to an invalid address. The reliable detection of this error is implementation dependent. ERRORS AUTHOR sigaction() was derived from the IEEE POSIX 1003.1-1988 Standard.
sigaltstack(2) sigaltstack(2) NAME sigaltstack - set and/or get signal alternate stack context. SYNOPSIS #include int sigaltstack(const stack_t *ss, stack_t *oss); DESCRIPTION The sigaltstack() function allows a process to define and examine the state of an alternate stack for signal handlers. Signals that have been explicitly declared to execute on the alternate stack will be delivered on the alternate stack.
sigaltstack(2) sigaltstack(2) On some implementations, stack space is automatically extended as needed. On those implementations, automatic extension is typically not available for an alternate stack. If the stack overflows, the behavior is undefined. Threads Considerations Each thread may define an alternate signal handling stack. LWP (Light Weight Processes) Considerations Each LWP may define an alternate signal handling stack. SEE ALSO sigaction(2), setjmp(3C), .
sigblock(2) sigblock(2) (TO BE OBSOLETED) NAME sigblock - block signals SYNOPSIS #include long sigblock(long mask); DESCRIPTION sigblock() causes the signals specified in mask to be added to the set of signals currently being blocked from delivery. Signal i is blocked if the i-th bit in mask is 1, as specified with the macro sigmask( i). It is not possible to block signals that cannot be ignored, as documented in signal(5); this restriction is silently imposed by the system.
sighold(2V) sighold(2V) NAME sigset, sighold, sigrelse, sigignore, sigpause - signal management SYNOPSIS #include void (*sigset(int sig, void (*func)(int)))(int); int sighold(int sig); int sigrelse(int sig); int sigignore(int sig); int sigpause(int sig); DESCRIPTION The system defines a set of signals that can be delivered to a process. The set of signals is defined in signal(5), along with the meaning and side effects of each signal.
sighold(2V) sighold(2V) For the other functions, a 0 value indicates that the call succeeded. A -1 return value indicates an error occurred and errno is set to indicate the reason. ERRORS sigset() fails and the system signal action for sig is not changed if any of the following occur: [EFAULT] The func argument points to memory that is not a valid part of the process address space. Reliable detection of this error is implementation dependent.
siginterrupt(2) siginterrupt(2) NAME siginterrupt - allow signals to interrupt functions SYNOPSIS #include int siginterrupt(int sig, int flag); DESCRIPTION The siginterrupt() function is used to change the restart behaviour when a function is interrupted by the specified signal. The function siginterrupt (sig, flag) has an effect as if implemented as: siginterrupt(int sig, int flag) { int ret; struct sigaction act; (void) sigaction(sig, NULL, &act); if (flag) act.
signal(2) signal(2) NAME signal, sigset, sighold, sigrelse, sigignore, sigpause - signal management SYNOPSIS #include void (*signal(int sig, void (*func)(int)))(int); int sighold(int sig); int sigignore(int sig); int sigpause(int sig); int sigrelse(int sig); void (*sigset(int sig, void (*disp)(int)))(int); DESCRIPTION The signal() function chooses one of three ways in which receipt of the signal number sig is to be subsequently handled.
signal(2) signal(2) The sigpause() function removes sig from the calling process’ signal mask and suspends the calling process until a signal is received. If the action for the SIGCHLD signal is set to SIG_IGN , child processes of the calling processes will not be transformed into zombie processes when they terminate.
signal(2) signal(2) Issue 4 The following changes are incorporated for alignment with the ISO C standard: - The function is no longer marked as an extension. - The argument int is added to the definition of func() in the SYNOPSIS section. - In Issue 3, this interface cross-referred to sigaction() . This issue provides a complete description of the function as defined in ISO C standard. Another change is incorporated as follows: - The APPLICATION USAGE section is added.
signal(2) signal(2) HP-UX EXTENSIONS SYNOPSIS void (*signal(int sig, void (*action)(int)))(int); void (*sigset(int sig, void (*func)(int)))(int); DESCRIPTION The system defines a set of signals that can be delivered to a process. The set of signals is defined in signal(5), along with the meaning and side effects of each signal. An alternate mechanism for handling these signals is defined here.
signal(2) sig signal(2) can be any one of the signals described under signal(5) except SIGKILL or SIGSTOP . func is assigned one of four values: SIG_DFL , SIG_IGN , SIG_HOLD , or a function address. The actions prescribed by SIG_DFL and SIG_IGN are described under signal(5). The action prescribed by SIG_HOLD and function address are described below: SIG_HOLD Hold signal. The signal sig is held upon receipt. Any pending signal of this signal type remains held. Only one signal of each type is held.
signal(2) signal(2) AUTHOR signal() was developed by HP, AT&T, and the University of California, Berkeley. SEE ALSO kill(1), init(1M), exit(2), kill(2), lseek(2), pause(2), sigaction(2), sigvector(2), wait(2), abort(3C), setjmp(3C), signal(5).
sigpending(2) sigpending(2) NAME sigpending - examine pending signals SYNOPSIS #include int sigpending(sigset_t *set); DESCRIPTION sigpending() stores sets of signals that are blocked from delivery and are pending to the calling process, at the location pointed to by set. RETURN VALUE Upon successful completion, sigpending() returns 0. Otherwise −1 is returned and errno is set to indicate the error. ERRORS No errors are defined.
sigpending(2) sigpending(2) HP-UX EXTENSIONS ERRORS sigpending() fails if the following condition is encountered: [EFAULT] set points to an invalid address. The reliable detection of this error is implementationdependent. AUTHOR sigpending() was derived from the IEEE POSIX 1003.1-1988 Standard. SEE ALSO sigaction(2), sigsuspend(2), sigprocmask(2), sigsetops(3C), signal(5). STANDARDS CONFORMANCE sigpending() : AES, SVID3, XPG3, XPG4, FIPS 151-2, POSIX.
sigprocmask(2) sigprocmask(2) NAME sigprocmask - examine and change blocked signals SYNOPSIS #include int sigprocmask( int how, const sigset_t *set, sigset_t *oset ); DESCRIPTION The sigprocmask() function allows the calling process to examine and/or change its signal mask. If the argument set is not a null pointer, it points to a set of signals to be used to change the currently blocked set.
sigprocmask(2) sigprocmask(2) Entry included foralignment with the POSIX.1-1988 standard. Issue 4 The following change is incorporated for alignment with the ISO POSIX-1 standard: - The type of the arguments set and oset are changed from sigset_t* to const sigset_t* . Another change is incorporated as follows: - The DESCRIPTION section is changed to indicate that signals can also be generated by raise() .
sigprocmask(2) sigprocmask(2) HP-UX EXTENSIONS ERRORS sigprocmask() fails if any of the following conditions are encountered: [EFAULT] set or oset points to an invalid address. The reliable detection of this error is implementation dependent. AUTHOR sigprocmask() was derived from the IEEE POSIX 1003.1-1988 Standard. SEE ALSO sigaction(2), sigsuspend(2), sigpending(2), sigsetops(3C), signal(5). STANDARDS CONFORMANCE sigprocmask(): AES, SVID3, XPG3, XPG4, FIPS 151-2, POSIX.
sigqueue(2) sigqueue(2) NAME sigqueue() - queue a signal to a process SYNOPSIS #include int sigqueue(pid_t pid, int signo, const union sigval value); DESCRIPTION The sigqueue() system call causes the signal specified by signo to be sent with the value specified by value to the process specified by pid. If signo is zero (the null signal), error checking is performed but no signal is actually sent. The null signal can be used to check the validity of pid.
sigsend(2) sigsend(2) NAME sigsend(), sigsendset() - send a signal to a process or a group of processes SYNOPSIS #include #include int sigsend (idtype_t idtype, id_t id, int sig); int sigsendset (const procset_t *psp, int sig); DESCRIPTION The sigsend() system call sends a signal to a process or a group of processes. The process or group of processes to which the signal is to be sent is specified by id and idtype.
sigsend(2) sigsend(2) RETURN VALUE Upon successful completion, sigsend() returns a value of 0. Otherwise, it returns a value of −1 and sets errno to indicate the error. ERRORS If sigsend() fails, it sets errno (see errno(2)) to one of the following values: [EINVAL] sig is neither a valid signal number nor zero. [EINVAL] idtype is not a valid value. [EINVAL] sig is SIGKILL , idtype is P_PID , and id is 1. [ESRCH] No process can be found corresponding to that specified by id and idtype.
sigsetmask(2) sigsetmask(2) (TO BE OBSOLETED) NAME sigsetmask - set current signal mask SYNOPSIS #include long sigsetmask(long mask); DESCRIPTION sigsetmask() sets the current signal mask (those signals that are blocked from delivery). Signal i is blocked if the i-th bit in mask, as specified with the macro sigmask( i), is a 1. It is not possible to mask signals that cannot be ignored, as documented in signal(5); this restriction is silently imposed by the system.
sigspace(2) sigspace(2) NAME sigspace - assure sufficient signal stack space SYNOPSIS #include ssize_t sigspace(ssize_t stacksize); DESCRIPTION sigspace() requests additional stack space that is guaranteed to be available for processing signals received by the calling process. If the value of stacksize is positive, it specifies the size of a space, in bytes, which the system guarantees to be available when processing a signal.
sigspace(2) sigspace(2) LWP (Lightweight Processes) Considerations Each LWP may define an alternate signal handling stack. AUTHOR sigspace() was developed by HP. SEE ALSO sigaction(2), sigstack(2), sigvector(2), malloc(3C), setjmp(3C).
sigstack(2) sigstack(2) (TO BE OBSOLETED) NAME sigstack - set and/or get signal stack context SYNOPSIS #include int sigstack( struct sigstack *ss, struct sigstack *oss ); DESCRIPTION The sigstack() function allows the calling process to indicate to the system an area of its address space to be used for processing signals received by the process. If the ss argument is not a null pointer, it must point to a sigstack structure.
sigstack(2) sigstack(2) (TO BE OBSOLETED) the signal stack is SIGSTKSZ as found in . An implementation that would like to specify a signal stack size other than SIGSTKSZ should use sigaltstack(). Programs should not use longjmp() to leave a signal handler that is running on a stack established with sigstack() . Doing so may disable future use of the signal stack. For abnormal exit from a signal handler, siglongjmp() , setcontext() , or swapcontext() may be used.
sigstack(2) sigstack(2) HP-UX EXTENSIONS - TO BE OBSOLETED SYNOPSIS int sigstack( const struct sigstack *ss, struct sigstack *oss ); DESCRIPTION The correct use of sigstack() is hardware dependent, and therefore is not portable between different HP-UX implementations. sigspace() is portable between different HP-UX implementations and should be used when the application does not need to know where the signal stack is located (see sigspace(2)).
sigsuspend(2) sigsuspend(2) NAME sigsuspend - wait for a signal SYNOPSIS #include int sigsuspend(const sigset_t *sigmask); DESCRIPTION The sigsuspend() function replaces the process’ current signal mask with the set of signals pointed to by sigmask and then suspends the process until delivery of a signal whose action is either to execute a signal-catching function or to terminate the process. If the action is to terminate the process then sigsuspend() will never return.
sigsuspend(2) sigsuspend(2) HP-UX EXTENSIONS ERRORS [EFAULT] sigmask points to an invalid address. implementation-dependent. The reliable detection of this error is AUTHOR sigsuspend() was derived from the IEEE POSIX 1003.1-1988 Standard. SEE ALSO sigaction(2), sigpending(2), sigprocmask(2), sigsetops(3C), signal(5), thread_safety(5). STANDARDS CONFORMANCE sigsuspend() : AES, SVID3, XPG3, XPG4, FIPS 151-2, POSIX.
sigvector(2) sigvector(2) (TO BE OBSOLETED) NAME sigvector - software signal facilities SYNOPSIS #include int sigvector( int sig, const struct sigvec *vec, struct sigvec *ovec ); DESCRIPTION The system defines a set of signals that can be delivered to a process. The set of signals is defined in signal(5), along with the meaning and side effects of each signal.
sigvector(2) sigvector(2) (TO BE OBSOLETED) Use the Berkeley signal semantics. SV_BSDSIG SV_RESETHAND Use the semantics of signal(2). If SV_ONSTACK is set, the system uses or permits the use of the space reserved for signal processing in the sigspace() system call. If SV_BSDSIG is set, the signal is given the Berkeley semantics.
sigvector(2) sigvector(2) (TO BE OBSOLETED) Call read (slow devices) readv (slow devices) write (slow devices) writev (slow devices) open (slow devices) ioctl (slow requests) close (slow requests) wait select pause sigpause semop msgsnd msgrcv sc_syscall value SYS_READ SYS_READV SYS_WRITE SYS_WRITEV SYS_OPEN SYS_IOCTL SYS_CLOSE SYS_WAIT SYS_SELECT SYS_PAUSE SYS_SIGPAUSE SYS_SEMOP SYS_MSGSND SYS_MSGRCV These system calls are not defined if the preprocessor macro _XPG2 is defined when
sigvector(2) sigvector(2) (TO BE OBSOLETED) APPLICATION USAGE Threads Considerations The signal disposition (such as catch/ignore/default) established by sigvector() is shared by all threads in the process. Each thread maintains its own blocked signal mask. For more information regarding signals and threads, refer to signal(5). AUTHOR sigvector() was developed by HP and the University of California, Berkeley.
sigwait(2) sigwait(2) NAME sigwait(), sigwaitinfo(), sigtimedwait() - synchronously accept a signal SYNOPSIS #include int sigwait(const sigset_t *set, int *sig); int sigwaitinfo(const sigset_t *set, siginfo_t *info); int sigtimedwait(const sigset_t *set, siginfo_t *info, const struct timespec *timeout); DESCRIPTION The sigwait() function atomically selects and clears a pending signal from set and returns the signal number in the location pointed to by sig.
sigwait(2) sigwait(2) Upon successful completion, sigwaitinfo() and sigtimedwait() will return the selected signal number. Otherwise a value of -1 is returned and errno is set to indicate the error. ERRORS If any of the following conditions occur, the sigwait family of routines will return the following error number: [EAGAIN] sigtimedwait() was called and no signal in the set parameter was delivered within the time interval specified by the timeout parameter.
socket(2) socket(2) NAME socket() - create an endpoint for communication SYNOPSIS #include AF_CCITT Only #include int socket(int af, int type, int protocol); DESCRIPTION The socket() system call creates an endpoint for communication and returns a descriptor. The socket descriptor returned is used in all subsequent socket-related system calls. The af parameter specifies an address family to be used to interpret addresses in later operations that specify the socket.
socket(2) socket(2) If the socket is in the AF_CCITT address family, only the SOCK_STREAM socket type is supported. Refer to the topic "Comparing X.25 Level 3 Access to IP" in the X.25 Programmer’s Guide for more details on the difference between programmatic access to X.25 via IP and X.25 Level 3. If the socket is in the AF_CCITT family, the connection and all other operations pass data directly from the application to the X.25 Packet Level (level 3) without passing through a TCP or UDP protocol.
socketpair(2) socketpair(2) NAME socketpair() - create a pair of connected sockets SYNOPSIS #include int socketpair(int af, int type, int protocol, int sv[2]); DESCRIPTION The socketpair() system call creates an unnamed pair of connected sockets and returns two file descriptors in sv[0] and sv[1]. The two sockets are indistinguishable. af specifies the address family. See socket(2). type specifies the semantics of communication for the socket.
stat(2) stat(2) NAME stat - get file status SYNOPSIS #include #include int stat(const char *path, struct stat *buf); DESCRIPTION The stat() function obtains information about the named file and writes it to the area pointed to by the buf argument. The path argument points to a pathname naming a file. Read, write or execute permission of the named file is not required, but all directories listed in the pathname leading to the file must be searchable.
stat(2) stat(2) security controls" are replaced by "additional or alternate file access control mechanisms." The following change is incorporated for alignment with the FIPS requirements: • In the ERRORS section, the condition whereby [ENAMETOOLONG] will be returned if a pathname component is larger that {NAME_MAX} is now defined as mandatory and marked as an extension. Another change is incorporated as follows: • The header
stat(2) stat(2) HP-UX EXTENSIONS DESCRIPTION If the chosen path name or file descriptor refers to a Multi-Level Directory (MLD), and the process does not have the multilevel effective privilege, the i-node number returned in st_ino is the i-node of the MLD itself. The parameters for the stat() function are as follows: path is a pointer to a path name of any file within the mounted file system.(All directories listed in the path name must be searchable.
stat(2) stat(2) DEPENDENCIES CD-ROM The st_uid and st_gid fields are set to −1 if they are not specified on the disk for a given file. AUTHOR stat() and fstat() were developed by AT&T. lstat() was developed by the University of California, Berkeley. SEE ALSO touch(1), acl(2), chmod(2), chown(2), creat(2), link(2), mknod(2), pipe(2), read(2), rename(2), setacl(2), stat64(2), sysfs(2), time(2), truncate(2), unlink(2), utime(2), write(2), acl(5), aclv(5), stat(5).
statfs(2) statfs(2) NAME statfs, fstatfs - get file system statistics SYNOPSIS #include int statfs(const char *path, struct statfs *buf); int fstatfs(int fildes, struct statfs *buf); DESCRIPTION statfs() returns status information for a mounted file system. fstatfs() returns similar information for an open file. The parameters for the statfs() and fstatfs() functions are as follows: path is a pointer to a path name of any file within the mounted file system.
statfs(2) statfs(2) [EFAULT] buf points to an invalid address. [EIO] An I/O error occurs while reading from or writing to the file system. AUTHOR statfs() and fstatfs() were developed by Sun Microsystems, Inc. SEE ALSO df(1M), stat(2), ustat(2).
statvfs(2) statvfs(2) NAME statvfs, fstatvfs - get file system information SYNOPSIS #include #include int statvfs (const char *path, struct statvfs *buf); int fstatvfs (int fildes, struct statvfs *buf); DESCRIPTION statvfs() returns information about a mounted file system. fstatvfs() returns similar information about an open file.
statvfs(2) statvfs(2) [ELOOP] Too many symbolic links are encountered during path-name translation. [ENAMETOOLONG] The length of the specified path name exceeds PATH_MAX bytes, or the length of a component of the path name exceeds NAME_MAX bytes while _POSIX_NO_TRUNC is in effect. [ENOENT] The named file does not exist (for example, path is null or a component of path does not exist). [ENOTDIR] A component of the path prefix is not a directory.
stime(2) stime(2) NAME stime() - set time and date SYNOPSIS #include int stime(const time_t *tp); DESCRIPTION The stime() system call sets the system time and date. tp points to the value of time as measured in seconds from 00:00:00 on January 1, 1970, Coordinated Universal Time (UTC). RETURN VALUE stime() returns the following values: 0 Successful completion. -1 Failure. errno is set to indicate the error. ERRORS If stime() fails, errno is set to one of the following values.
stream(2) stream(2) NAME stream: open(), close(), read(), readv(), write(), writev(), ioctl(), select(), signal() - STREAMS enhancements to standard system calls DESCRIPTION The open() , close() , read() , readv() , write() , writev() , ioctl() , select() , and signal() system calls are enhanced to support STREAMS. The new functionality is described below for each system call.
stream(2) • stream(2) read() , getmsg() , or getpmsg() call. If no data was read, read() consumes the message. If the read mode is message-discard or message-nondiscard, the read() function returns zero, and then consumes the message. The read() function reads the data at the front of the stream head read queue. It reads both priority band and normal data. The read() function processes control messages according to the STREAMS read flags: RPROTNORM , RPROTDAT , and RPROTDIS .
stream(2) stream(2) A write to a STREAMS device may fail for one or more of the following STREAMS-specific conditions: [EAGAIN] The O_NONBLOCK flag is set, and the stream cannot accept write() data because it is flow controlled. [EINVAL] The write() function attempts to write to a stream that is linked below a multiplexor. [ENXIO] A hangup occurs on a stream while the write() function is writing to the stream. [ERANGE] The nbytes parameter is not within the allowable range.
stty(2) stty(2) (TO BE OBSOLETED) NAME stty(), gtty() - control terminal device (Bell Version 6 compatibility) SYNOPSIS #include int stty(int fildes, const struct sgttyb *argp); int gtty(int fildes, struct sgttyb *argp); Remarks These system calls are preserved for backward compatibility with Bell Version 6. They provide as close an approximation as possible to the old Version 6 functions. All new code should use the TCSETA and TCGETA ioctl() calls described in termio(7).
swapon(2) swapon(2) NAME swapon - add swap space for interleaved paging/swapping SYNOPSIS #include int swapon(const char *path, ... /* [int min, int limit, int reserve,] int priority */ ); Remarks The ANSI C ", ... " construct denotes a variable length argument list whose optional and required members are given in the associated comment (/* */ ). DESCRIPTION The swapon() system call makes a block device or a directory named path available to the system for paging and swapping.
swapon(2) swapon(2) [EIO] Unable to read the device associated with path. [ELOOP] Too many symbolic links were encountered in translating the path name. [ENAMETOOLONG] The length of the specified path name exceeds PATH_MAX bytes, or the length of a component of the path name exceeds NAME_MAX bytes while _POSIX_NO_TRUNC is in effect. [ENODEV] The device associated with path does not exist. [ENOENT] The system-imposed limit on the number of swap file entries has been reached.
symlink(2) symlink(2) NAME symlink - make symbolic link to a file SYNOPSIS #include int symlink(const char *path1, const char *path2); DESCRIPTION The symlink() function creates a symbolic link. Its name is the pathname pointed to by path2, which must be a pathname that does not name an existing file or symbolic link. The contents of the symbolic link are the string pointed to by path1. RETURN VALUE Upon successful completion, symlink() returns 0.
symlink(2) symlink(2) HP-UX EXTENSIONS ERRORS If symlink() fails, errno is set to one of the following values. [EFAULT] path1 or path2 points outside the process’s allocated address space. The reliable detection of this error is implementation-dependent. [EIO] An I/O error occurred while making the directory entry for path2, allocating the inode for path2, or writing out the link contents of path2. [EIO] An I/O error occurred while making the directory entry or allocating the inode.
sync(2) sync(2) NAME sync - update disk SYNOPSIS #include void sync(void); DESCRIPTION sync() causes all information in memory that should be on disk to be written out. This includes modified file system meta-data and delayed block I/O. It should be used by commands and programs that examine a file system, such as fsck , df , etc. It is mandatory before a shutdown. The writing, although scheduled, is not necessarily complete upon return from sync.
sysconf(2) sysconf(2) NAME sysconf(), CPU_IS_PA_RISC() - get configurable system variables SYNOPSIS #include long sysconf(int name); int CPU_IS_PA_RISC(long cpuvers); DESCRIPTION The sysconf() system call provides a way for applications to determine the current value of a configurable limit or variable. The name argument represents the system variable being queried.
sysconf(2) sysconf(2) file (see localedef(1M)) CPU_KEYBITS1 _SC_CPU_KEYBITS1 Processor Extensions (see below) CPU_VERSION _SC_CPU_VERSION Version of CPU architecture (see below) EXPR_NEST_MAX _SC_EXPR_NEST_MAX Maximum parenthesis nesting level for expr expressions (see expr(1)) HW_32_64_CAPABLE _SC_HW_32_64_CAPABLE Returns which kernel is supported on the hardware.
sysconf(2) s sysconf(2) POSIX_SYNCHRONIZED_IO _SC_SYNCHRONIZED_IO Positive if the Synchronized IO option is supported (see open(2)) POSIX_TIMERS _SC_TIMERS Positive if the system supports POSIX.4 clocks and timers; −1 otherwise POSIX_VERSION _SC_VERSION Approval date of the POSIX.1 Standard (such as 199009 for POSIX.1-1990) to which the system conforms. This value indicates the year (first four digits) and month (next two digits) that the standard was approved by the IEEE Standards Board.
sysconf(2) sysconf(2) POSIX_THREAD_ PRIO_PROTECT _SC_THREAD_ PRIO_PROTECT Positive if the implementation supports the POSIX Thread Priority Protection option; -l otherwise. POSIX_THREAD_ PROCESS_SHARED _SC_THREAD_PROCESS_ SHARED Positive if the implementation supports the POSIX Thread Process-Shared Synchronization option; -l otherwise. POSIX_THREAD_ SAFE_FUNCTIONS _SC_THREAD_SAFE_ FUNCTIONS Positive if the implementation supports the POSIX Thread Thread-Safe Functions option; -l otherwise.
sysconf(2) sysconf(2) XOPEN_SHM _SC_XOPEN_SHM Equal to 1 if the X/Open Shared Memory Feature Group is supported; −1 otherwise XOPEN_VERSION _SC_XOPEN_VERSION Issue number of X/Open Portability Guide supported XBS5_ILP32_ OFF32 _SC_XBS5_ILP32_ OFF32 A flag which denotes whether _CS_XBS5_ILP32_OFF32_CFLAGS, _CS_XBS5_ILP32_OFF32_LDFLAGS, _CS_XBS5_ILP32_OFF32_LIBS and _CS_XBS5_ILP32_OFF32_LINTFLAGS are supported by confstr(3C). A return value of -1 indicates they are not supported.
sysconf(2) sysconf(2) XX HP-UX major release number yy HP-UX minor release number ZZZZ Library specific number q 0=32PA 1=64PA 2=32EM 3=64EM 4-9=Reserved N 0 = archive library 1-9 = System V version of shared library RETURN VALUE Upon successful completion, sysconf() returns the value of the named variable. If the value of name is not valid, sysconf() returns −1 and sets errno to indicate the error.
sysconf(2) sysconf(2) HP Process Resource Manager: prmconfig(1) in HP Process Resource Manager User’s Guide STANDARDS CONFORMANCE sysconf() : AES, SVID3, XPG3, XPG4, FIPS 151-2, POSIX.1, POSIX.2, POSIX.
sysfs(2) sysfs(2) NAME sysfs - get file system type information SYNOPSIS #include int sysfs(int opcode, const char *fsname); int sysfs(int opcode, int fs_index, char *buf ); int sysfs(int opcode); DESCRIPTION sysfs is used to return information about the file system types configured in the system. The number arguments accepted by sysfs varies and depends on the opcode.
time(2) time(2) NAME time - get time SYNOPSIS #include time_t time(time_t *tloc); DESCRIPTION time() returns the value of time in seconds since the Epoch. If tloc is not a null pointer, the return value is also assigned to the object to which it points. RETURN VALUE Upon successful completion, time() returns the value of time. Otherwise, a value of (time_t )−1 is returned and errno is set to indicate the error. ERRORS [EFAULT] time() fails if tloc points to an illegal address.
timers(2) timers(2) NAME timer_create(), timer_delete(), timer_settime(), timer_gettime(), timer_getoverrun() - timer operations SYNOPSIS #include
timers(2) timers(2) If the flag TIMER_ABSTIME is set in the argument flags , timer_settime() behaves as if the time until next expiration is set equal to the difference between the absolute time specified by the it_value member of value and the current value of the clock associated with timerid . That is, the timer will expire when the clock reaches the value specified by the it_value member of value .
timers(2) timers(2) [EINVAL] The specified clock ID is not defined. [EFAULT] The timerid or evp argument points to an invalid address. [ENOSYS] The function timer_create() is not supported by this implementation. If any of the following conditions occur, the timer_delete() function returns −1 and sets errno to the corresponding value: [EINVAL] The timer ID specified by timerid is not a valid timer ID. [ENOSYS] The function timer_delete() is not supported by this implementation.
timers(2) timers(2) if (timer_settime(timerid, 0, &one_minute, (struct itimerspec == -1) { perror("timer_create"); exit(1); } pause(); if (timer_delete(timerid) == -1) { perror("timer_delete"); exit(1); } return 0; } AUTHOR timer_create(), timer_delete(), timer_settime(), timer_gettime(), timer_getoverrun() were derived from the proposed IEEE POSIX P1003.4 standard, draft 14. and SEE ALSO clocks(2), getitimer(2), thread_safety(5). STANDARDS CONFORMANCE timer_create(): POSIX.4 timer_delete(): POSIX.
times(2) times(2) NAME times - get process and child process times SYNOPSIS #include clock_t times(struct tms *buffer); DESCRIPTION times() fills the structure pointed to by buffer with time-accounting information. The structure defined in
truncate(2) truncate(2) NAME ftruncate, truncate - truncate a file to a specified length SYNOPSIS #include int ftruncate(int fildes, off_t length); int truncate(const char *path, off_t length); DESCRIPTION The ftruncate() function causes the regular file referenced by fildes to have a size of length bytes. The truncate() function causes the regular file named by path to have a size of length bytes. The effect of ftruncate() and truncate() on other types of files is unspecified.
truncate(2) truncate(2) SEE ALSO open(2), . CHANGE HISTORY First released in Issue 4, Version 2.
truncate( ) truncate( ) HP-UX EXTENSIONS SYNOPSIS int truncate(const char *path, size_t length); int ftruncate(int fildes, size_t length); ERRORS If truncate() fails, errno is set to one of the following values: [EACCES] MAC access is denied on the file. [EDQUOT] The user’s disk quota block limit has been reached for this file system. [EFAULT] path points outside the process’s allocated address space. The reliable detection of this error is implementation dependent.
ttrace(2) ttrace(2) NAME ttrace - tracing facility for multithreaded processes SYNOPSIS #include int ttrace (ttreq_t request, pid_t pid, lwpid_t lwpid, uint64_t addr, uint64_t data, uint64_t addr2); Remarks While the posix API is defined and will not change, the present underlying system calls are not guaranteed to be compatible with future versions. Much of the functionality of this capability is highly dependent on the underlying hardware.
ttrace(2) ttrace(2) The addr argument specifies the offset to be read from. The data argument specifies the number of bytes to read and the addr2 argument specifies where to store that data in the tracing process. The lwpid argument must be set to zero. TT_PROC_WRTEXT TT_PROC_WRDATA These requests allow writing into the target process text (TT_PROC_WRTEXT) and data spaces (TT_PROC_WRDATA). The addr argument specifies the offset to be written to. The data argument specifies the number of bytes to write.
ttrace(2) ttrace(2) by child processes and/or threads. Refer to the EVENTS section below. If TTEO_NORM_SIGTRAP is set, the SIGTRAP signal behaves normally. That is, it is getting delivered (the default behavior is to drop these signals). TT_PROC_SET_EVENT_MASK This request allows the tracing process to establish events and signals the traced process will respond to. Refer to the EVENTS section for a description of these events.
ttrace(2) ttrace(2) TTS_INSYSCALL TTS_IS32BIT TTS_ATEXIT = 0x0010 = 0x0020 = 0x0040 The following three arguments provide information regarding the system call being executed when the thread was stopped. This information is valid only if the TTS_INSYSCALL bit is set in tts_flags . tts_scno is the system call number. tts_scnargs is the number of arguments of the system call. tts_scarg is the argument list of the system call.
ttrace(2) ttrace(2) The data associated with a TTEVT_LWP_EXIT event is as follows: typedef struct { int tts_exitcode; } ttexit_data_t; tts_exitcode is the exit code of the process. The data associated with a TTEVT_BPT_SSTEP event is as follows: typedef struct { int tts_isbpt; } ttbpt_data_t; tts_isbpt is set to zero if it is a single-step and to one if the event is a breakpoint (including single-stepping into a breakpoint).
ttrace(2) ttrace(2) All other requests, except non debug-related requests below, are targeted to a specific thread in the traced process. Also, all other requests require both the pid of the traced process and an lwpid specifying a valid thread in the process being traced. These requests are prefixed by TT_LWP_ and are as follows: TT_LWP_STOP This request causes the thread identified by lwpid to stop executing. If the thread is already stopped by the debugger, or by an event, an error is returned.
ttrace(2) ttrace(2) across fork() using the tte_opts options in the ttevent_t structure. If TTEO_PROC_INHERIT is set, the child process inherits the event mask of its parent. If TTEO_LWP_INHERIT is set, the lwp inherits the event mask of the lwp that invoked fork() . If the latter is set, the lwp created by lwp_create() also inherits the event mask of the creating thread.
ttrace(2) ttrace(2) lwp_create() system call is invoked to create a thread. When set, the calling thread stops and provides the debugger with the lwpid of the newly created thread. TTEVT_LWP_EXIT This event flag indicates that the debugger wants to be notified when a thread is exiting via the lwp_exit() system call. The thread stops upon entry to the system call.
ttrace(2) ttrace(2) [EINVAL] [EACCES] Invalid offset (TT_LWP_RUREGS, TT_LWP_WUREGS). ptrace() and ttrace() requests are being mixed. An offset in the save_state structure is not word-aligned. An invalid register is targeted by TT_LWP_WUREGS. The size argument to a TT_PROC_GET_PATHNAME is larger than MAXPATHLEN . The pid argument to the TT_PROC_ATTACH is the pid of the invoker. [EACCES] The process is already being traced.
ttrace(2) ttrace(2) gen_name(_exp_t *base, int val) { _exp_t *rp; for (rp = base; rp->name; rp++) { if (val == rp->val) { return rp->name; } } return NULL; } static char * ev_name(ttevents_t ev) { char buf[32]; char *p; static _exp_t tab[] = { TTEVT_SIGNAL, "SIGNAL", TTEVT_FORK, "FORK", TTEVT_EXEC, "EXEC", TTEVT_EXIT, "EXIT", TTEVT_VFORK, "VFORK", TTEVT_SYSCALL, "SYSCALL", TTEVT_SYSCALL_ENTRY, "SYSCALL_ENTRY", TTEVT_LWP_CREATE, "LWP_CREATE", TTEVT_LWP_TERMINATE, "LWP_TERMINATE", TTEVT_LWP_EXIT, "LWP_EXIT"
ttrace(2) ttrace(2) TT_PROC_CONTINUE, TT_PROC_SET_EVENT_MASK, TT_PROC_GET_FIRST_LWP_STATE, TT_PROC_GET_NEXT_LWP_STATE, TT_LWP_CONTINUE, -1, "PROC_CONTINUE", "PROC_SET_EVENT_MASK", "PROC_GET_FIRST_LWP_STATE", "PROC_GET_NEXT_LWP_STATE", "LWP_CONTINUE", NULL }; rval = ttrace(req, pid, lwpid, addr, data, addr2); if (rval == -1) { p = gen_name(tab, req); errexit(p ? p : "ttrace"); } } static void show_syscall(const ttstate_t *stp) { int nargs = stp->tts_scnargs; ttevents_t evt = stp->tts_event; int i; char *
ttrace(2) ttrace(2) for (i = 0, argp = stp->tts_scarg; i < nargs; i++, argp++) { (void) printf("%#llx", *argp); (void) printf("%s", (i == nargs - 1) ? "" : ", "); } (void) printf(")"); } if (stp->tts_event == TTEVT_SYSCALL_RETURN) { if (stp->tts_u.tts_syscall.tts_errno) { (void) printf(" ERR%d", stp->tts_u.tts_syscall.tts_errno); } else { (void) printf(" = %lld", stp->tts_u.tts_syscall.tts_rval[0]); } } else { (void) printf(" ...
ttrace(2) ttrace(2) ev.tte_opts = TTEO_NONE; if (pid) { siginfo_t si; dottrace(TT_PROC_ATTACH, pid, 0, TT_DETACH_ON_EXIT, TT_VERSION, 0); if (waitid(P_PID, pid, &si, WEXITED|WSTOPPED) < 0 || si.si_pid != pid || si.
ttrace(2) ttrace(2) if (rval < 0) { errexit("ttrace_wait"); } show_event(&st); if (st.tts_event == TTEVT_EXIT) { break; } dottrace(TT_LWP_CONTINUE, pid, st.tts_lwpid, TT_NOPC, st.tts_event == TTEVT_SIGNAL ? (uint64_t) st.tts_u.tts_signal.tts_signo : 0L, 0L); } return 0; } AUTHOR ttrace was developed by HP. SEE ALSO adb(1), fork(2), vfork(2), exec(2), signal(2), wait(2), ttrace_wait(2).
ttrace_wait(2) ttrace_wait(2) NAME ttrace_wait - wait for ttrace event SYNOPSIS #include int ttrace_wait(pid_t pid, lwpid_t lwpid, ttwopt_t option, ttstate_t *tsp, size_t size); DESCRIPTION The ttrace_wait() system call provides a means to wait for a ttrace() event to occur. A tracing process (debugger) will normally invoke ttrace_wait() after a process or any of its threads has been set running. ttrace_wait() synchronizes tracing requests directed at threads within the traced process.
ttrace_wait(2) ttrace_wait(2) AUTHOR ttrace_wait() was developed by HP. SEE ALSO ttrace(2), wait(2).
tuneinfo(2) tuneinfo(2) NAME tuneinfo - retrieve detailed information about kernel tunable parameters SYNOPSIS #include int tuneinfo(const char *tunable, tuneinfo_t *buf, size_t size, int count); DESCRIPTION This function provides detailed information about one or all kernel tunable parameters. If a particular parameter is of interest, specify it by name in tunable.
tuneinfo(2) tuneinfo(2) TIF_MINVALID The ti_minimum field contains a minimum allowed value for this parameter. TIF_MAXVALID The ti_maximum field contains a maximum allowed value for this parameter. RETURN VALUE If tuneinfo() is successful, it returns the number of tunable parameters for which information is available. (This number may exceed the supplied count parameter if the supplied buffer is too small to hold all tunable information.) If the function is not successful, it returns -1.
ualarm(2) ualarm(2) NAME ualarm - set the interval timer SYNOPSIS #include useconds_t ualarm(useconds_t useconds, useconds_t interval); DESCRIPTION The ualarm() function causes the SIGALRM signal to be generated for the calling process after the number of real-time microseconds specified by the useconds argument has elapsed. When the interval argument is non-zero, repeated timeout notification occurs with a period in microseconds specified by the interval argument.
ulimit(2) ulimit(2) NAME ulimit - get and set user limits SYNOPSIS #include long ulimit(int cmd, ...); Remarks The ANSI C ", ... " construct denotes a variable length argument list whose optional [or required] members are given in the associated comment (/* */ ). DESCRIPTION ulimit() provides for control over process limits. Available values for cmd are: UL_GETFSIZE Get the file size limit of the process. The limit is in units of 512-byte blocks and is inherited by child processes.
umask(2) umask(2) NAME umask - set and get file creation mask SYNOPSIS #include mode_t umask(mode_t cmask); DESCRIPTION umask() sets the process’s file mode creation mask to umask() and returns the previous value of the mask. Only the file access permission bits of the masks are used. The bits set in cmask specify which permission bits to turn off in the mode of the created file, and should be specified using the symbolic values defined in stat(5).
umount(2) umount(2) NAME umount - unmount a file system SYNOPSIS #include int umount(const char *name); DESCRIPTION umount() requests that a previously mounted file system contained on the block special device identified by name be unmounted. name is a pointer to a path name. After unmounting the file system, the directory upon which the file system was mounted reverts to its ordinary interpretation.
uname(2) uname(2) NAME uname(), setuname() - get information about computer system; set node name (system name) SYNOPSIS #include int uname(struct utsname *name); int setuname(const char *name, size_t namelen); DESCRIPTION uname() The uname() system call places information identifying the computer system in the utsname structure pointed to by name. The utsname structure, defined in
uname(2) [EPERM] uname(2) setuname() was attempted by a process lacking appropriate privileges. AUTHOR uname() was developed by AT&T and HP. SEE ALSO hostname(1), uname(1), setuname(1M), gethostname(2), sethostname(2). STANDARDS CONFORMANCE uname() : AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.
unlink(2) unlink(2) NAME unlink - remove directory entry; delete file SYNOPSIS #include int unlink(const char *path); DESCRIPTION The unlink() system call removes the directory entry named by the path name pointed to by path. When all links to a file have been removed and no process has the file open, the space occupied by the file is freed and the file ceases to exist.
unlink(2) unlink(2) SEE ALSO rm(1), close(2), link(2), open(2), rmdir(2), remove(3C). STANDARDS CONFORMANCE unlink() : AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.
usleep(2) usleep(2) NAME usleep - suspend execution for an interval SYNOPSIS #include int usleep(useconds_t useconds); DESCRIPTION The usleep() function will cause the calling thread to be suspended from execution until either the number of real-time microseconds specified by the argument useconds has elapsed, or a signal is delivered to the calling thread and its action is to invoke a signal-catching function or to terminate the process.
ustat(2) ustat(2) NAME ustat() - get mounted file system statistics SYNOPSIS #include int ustat(dev_t dev, struct ustat *buf); DESCRIPTION The ustat() system call returns information about a mounted file system. dev is a device number identifying a device containing a mounted file system. buf is a pointer to a ustat structure (defined in
utime(2) utime(2) NAME utime() - set file access and modification times SYNOPSIS #include int utime(const char *path, const struct utimbuf *times); DESCRIPTION The utime() system call sets the access and modification times of the file to which the path argument refers. If times is a NULL pointer, the access and modification times of the file are set to the current time. A process must be the owner of the file or have write permission on the file to use utime() in this manner.
utime(2) utime(2) STANDARDS CONFORMANCE utime() : AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.
utimes(2) utimes(2) NAME utimes - set file access and modification times SYNOPSIS #include int utimes(const char *path, const struct timeval times[2]); DESCRIPTION The utimes() function sets the access and modification times of the file pointed to by the path argument to the value of the times argument. The utimes() function allows time specifications accurate to the microsecond. For utimes() , the times argument is an array of timeval structures.
vfork(2) vfork(2) NAME vfork - spawn new process; share virtual memory SYNOPSIS #include pid_t vfork(void); REMARKS vfork() is a higher performance version of fork() that is provided on some systems where a performance advantage can be attained. If the calling process is multi-threaded, the newly created child process will only contain one thread. This one thread will be a copy of the thread calling vfork() .
vfork(2) vfork(2) Series 800 Process times for the parent and child processes within the [vfork ,exec ] window may be inaccurate. Parent and child processes share the same stack space within the [vfork ,exec ] window. If the size of the stack has been changed within this window by the child process (return from or call to a function, for example), it is likely that the parent and child processes will be killed with signal SIGSEGV or SIGBUS .
vfsmount(2) vfsmount(2) (TO BE OBSOLETED) NAME vfsmount - mount a file system SYNOPSIS #include int vfsmount(int type, const char *dir, int flags, caddr_t data); Remarks This routine is included only for compatibility with past releases. It works only with UFS (HFS), NFS, and CDFS file systems. For maximum portability and improved functionality, new applications should use the mount() system call (see mount(2)). DESCRIPTION The vfsmount() system call attaches a file system to a directory.
vfsmount(2) vfsmount(2) (TO BE OBSOLETED) MS_BEHIND and MS_DELAY are mutually exclusive. MS_NO_FSASYNC Specify that rigorous posting of file system metadata is to be used. This is the default. MS_FSASYNC Specify that relaxed posting of file system metadata is to be used. This may lead to better performance for certain applications; but there is increased potential for data loss in case of a crash. MS_FSASYNC and MS_NO_FSASYNC are mutually exclusive.
vfsmount(2) vfsmount(2) (TO BE OBSOLETED) [EINVAL] A value in a field of data is out of proper range. See mountd(1M), getfh(2), and inet(7F) for more information. WARNINGS The mount command (see mount(1M)) is preferred over vfsmount() because mount supports all mounting options that are available from vfsmount() directly, plus mount also maintains the /etc/mnttab file which lists what file systems are mounted. WARNINGS Obsolescent Interfaces vfsmount() is to be obsoleted at a future date.
wait(2) wait(2) NAME wait, waitpid - wait for child process to stop or terminate SYNOPSIS #include OH #include pid_t wait(int *stat_loc); pid_t waitpid(pid_t pid, int *stat_loc, int options); DESCRIPTION The wait() and waitpid() functions allow the calling process to obtain status information pertaining to one of its child processes. Various options permit status information to be obtained for child processes that have terminated or stopped.
wait(2) wait(2) WIFEXITED(stat_val) Evaluates to a non-zero value if status was returned for a child process that terminated normally. WEXITSTATUS(stat_val) If the value of WIFEXITED(stat_val) is non-zero, this macro evaluates to the low-order 8 bits of the status argument that the child process passed to _exit() or exit() , or the value the child process returned from main() .
wait(2) wait(2) ERRORS The wait() function will fail if: [ECHILD] The calling process has no existing unwaited-for child processes. [EINTR] The function was interrupted by a signal. The value of the location pointed to by stat_loc is undefined. The waitpid() function will fail if: [ECHILD] The process or process group specified by pid does not exist or is not a child of the calling process. [EINTR] The function was interrupted by a signal.
wait(2) wait(2) HP-UX EXTENSIONS NAME wait(), waitpid() - wait for child or traced process to stop or terminate DESCRIPTION wait() If a parent process terminates without waiting for its child processes to terminate, the parent process ID of each child process is set to 1. This means the initialization process inherits the child processes. WCOREDUMP(*stat_loc) If the value of WIFSIGNALED(*stat_loc) is nonzero, this macro evaluates to a nonzero value if a "core image" was produced (see signal(5)).
wait(2) wait(2) STANDARDS CONFORMANCE wait(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1 waitpid(): AES, SVID3, XPG3, XPG4, FIPS 151-2, POSIX.
wait3(2) wait3(2) NAME wait3 - wait for child process to change state SYNOPSIS #include pid_t wait3 (int *stat_loc, int options, struct rusage *resource_usage); DESCRIPTION The wait3() function allows the calling process to obtain status information for specified child processes.
wait3(2) wait3(2) HP-UX EXTENSIONS SYNOPSIS pid_t wait3(int *stat_loc, int options, int *reserved); DESCRIPTION The wait3() system call is equivalent to waitpid() with the value of pid equal to zero. The third parameter to wait3() , reserved , is currently unused and must always be a null pointer. ERRORS If wait3() fails, errno is set to one of the following values. [EINVAL] [EINVAL] The options argument to waitpid() or wait3() is invalid.
waitid(2) waitid(2) NAME waitid - wait for child process to change state SYNOPSIS #include int waitid(idtype_t idtype, id_t id, siginfo_t *infop, int options); DESCRIPTION The waitid() function suspends the calling process until one of its children changes state. It records the current state of a child in the structure pointed to by infop. If a child process changed state prior to the call to waitid() , waitid() returns immediately.
waitid(2) waitid(2) CHANGE HISTORY First released in Issue 4, Version 2.
write(2) write(2) NAME write, writev, pwrite - write on a file SYNOPSIS #include ssize_t write(int fildes, const void *buf, size_t nbyte); ssize_t pwrite(int fildes, const void *buf, size_t nbyte, off_t offset); #include ssize_t writev(int fildes, const struct iovec *iov, int iovcnt); DESCRIPTION The write() function attempts to write nbyte bytes from the buffer pointed to by buf to the file associated with the open file descriptor, fildes.
write(2) write(2) - The write() function will not block the process. - A write request for {PIPE_BUF} or fewer bytes will have the following effect: If there is sufficient space available in the pipe, write() will transfer all the data and return the number of bytes requested. Otherwise, write() will transfer no data and return −1 with errno set to [EAGAIN]. - A write request for more than {PIPE_BUF} bytes will case one of the following: a.
write(2) write(2) RETURN VALUE Upon successful completion, write() and pwrite() will return the number of bytes actually written to the file associated with fildes. This number will never be greater than nbyte. Otherwise, −1 is returned and errno is set to indicate the error. Upon successful completion, writev() returns the number of bytes actually written. Otherwise, it returns a value of −1, the file-pointer remains unchanged, and errno is set to indicate an error.
write(2) write(2) Issue 4 The following changes are incorporated for alignment with the ISO POSIX-1 standard: • The type of the argument buf is changed from char * to const void*, and the type of the argument byte is changed from unsigned size_t.
write(2) write(2) HP-UX EXTENSIONS DESCRIPTION The iovec structure is defined in /usr/include/sys/uio.h. For ordinary files, if the O_DSYNC file status flag is set, the write does not return until both the file data and the file attributes required to retrieve the data are physically updated.
write(2) [EDEADLK] write(2) A resource deadlock would occur as a result of this operation (see lockf(2) and fcntl(2)). [EDQUOT] User’s disk quota block limit has been reached for this file system. [EFBIG] The file is a regular file and nbyte is greater than zero and the starting position is greater than or equal to the offset maximum established in the open file description associated with fildes.
(Notes) (Notes) w Section 2−−486 Hewlett-Packard Company −1− HP-UX 11i Version 1: September 2005