HP-UX Reference Section 2: System Calls HP-UX 11i Version 3 Volume 5 of 10 Manufacturing Part Number : B2355-91021 E0207 Printed in USA © Copyright 1983-2007 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.
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.
Typographical Conventions audit (5) An HP-UX manpage reference. For example, 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 hyperlink 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 hyperlink to the book itself.
Command Syntax Literal A word or character that you enter literally. Replaceable A word or phrase that you replace with an appropriate value. -chars One or more grouped command options, such as -ikx. The chars are usually a string of literal characters that each represent a specific option. For example, the entry -ikx is equivalent to the individual options -i, -k, and -x. The plus character (+) is sometimes used as an option prefix. -word A single command option, such as -help.
Function Synopsis and Syntax HP-UX functions are described in a definition format rather than a usage format. The definition format includes type information that is omitted when the function call is actually included in a program. The function syntax elements are the same as for commands, except for the options; see “Command Syntax” on page 7. Function General Definition The general definition form is: type func ( type param [ , type param ]...
Revision History Part Number Release; Date; Format; Distribution B2355-60130 HP-UX 11i Version 3; February 2007; one volume HTML; http://docs.hp.com and Instant Information. B2355-91017-26 HP-UX 11i Version 3; February 2007; ten volumes PDF; http://docs.hp.com, Instant Information and print. B2355-60127 HP-UX 11i Version 1; September 2005 Update; one volume HTML; http://docs.hp.com and Instant Information. B2355-90902-11 HP-UX 11i Version 1; September 2005 Update; ten volumes PDF; http://docs.hp.
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 a process .........................................................................................................
Table of Contents Volume Five Entry Name(Section): name Description fadvise(2): fadvise() ............................................................................................... file advisory information fchdir(2): change working directory ........................................................................................... see chdir(2) fchmod(): change file mode access permissions ..........................................................................
Table of Contents Volume Five Entry Name(Section): name Description getsockname(2): getsockname() ....................................................................................... get socket address getsockopt(2): getsockopt(), setsockopt() ................................................. get and set options on sockets gettimeofday(2): gettimeofday() ................................................................................ get the date and time gettune(2): gettune() ...........................
Table of Contents Volume Five Entry Name(Section): name Description nanosleep(2): nanosleep() ............................................................................................ high resolution sleep nice(2): nice() ...................................................................................................... change priority of a process O_LARGEFILE(): non-POSIX standard API interfaces to support large files ............................... see creat64(2) open(2): open() ....................
Table of Contents Volume Five Entry Name(Section): name Description pstat_getpset(): get information for a processor set .................................................................. see pstat(2) pstat_getsem(): get information for a System V semaphore set .................................................. see pstat(2) pstat_getshm(): get information for a System V shared memory segment .................................. see pstat(2) pstat_getsocket(): get detailed information for a socket ............
Table of Contents Volume Five Entry Name(Section): name Description sendfile(2): sendfile() ................................................................ send the contents of a file through a socket sendfile64(2): sendfile64() ............................................. send the contents of a Large File through a socket sendmsg(): send a message from a socket ...................................................................................... see send(2) sendto(): send a message from a socket .......
Table of Contents Volume Five Entry Name(Section): name Description sigvec(): 4.2 BSD-compatible process control facilities ............................................................... see killpg(2) sigwait(2): sigwait(), sigwaitinfo(), sigtimedwait() ....................... examine and change signal action sigwaitinfo(): examine and change signal action ................................................................... see sigwait(2) socket(2): socket() .................................................
Notes 20 Hewlett-Packard Company HP-UX 11i Version 3: February 2007
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)). Note: 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) RTE_PSET_GETNEXTPSET __pset_rtctl(2) Return the ID of the next RTE processor set in the system after pset. The arg 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.
__pset_rtctl(2) __pset_rtctl(2) busy. See pset_setattr (2) for supported values. PSET_ATTR_NONEMPTY Indicates the behavior on a request to destroy a non-empty processor set. A non-empty processor set has at least one processor assigned to it. For RTE processor sets, such a request will be rejected by default. However, a user with appropriate privileges or a user with WRITE access to the pset can change the value of this attribute to allow deletion of an RTE processor set in use.
__pset_rtctl(2) __pset_rtctl(2) if ((ret = __pset_rtctl(RTE_PSET_CONFIG, new_psetid, 0)) < 0) { perror("__pset_rtctl()"); exit(2); } SEE ALSO psrset(1M), pset_assign(2), pset_bind(2), pset_ctl(2), pset_destroy(2), pset_getattr(2), pset_setattr(2), sysconf(2), privileges(5).
accept(2) accept(2) NAME accept() - accept a connection on a socket SYNOPSIS #include a AF_CCITT only #include
accept(2) accept(2) X/Open Sockets Compilation Environment See xopen_networking(7). RETURN VALUE Upon successful completion, accept() returns a nonnegative integer which is a descriptor for the accepted socket. 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: [EAGAIN] Nonblocking I/O is enabled using O_NONBLOCK and no connections are present to be accepted.
accept(2) accept(2) SEE ALSO bind(2), connect(2), listen(2), select(2), socket(2), privileges(5), thread_safety(5), xopen_networking(7).
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) access(2) ERRORS If access() fails, errno is set to one of the following values. a [EACCES] Search permission is denied on a component of the path prefix. [EACCES] The access control list does not permit the requested access and the real user ID is not a user with DACREAD or DACWRITE privileges. [EFAULT] path points outside the allocated address space for the process. The reliable detection of this error is implementation dependent.
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)).
acct(2) acct(2) STANDARDS CONFORMANCE acct() : SVID2, SVID3, XPG2 a 34 Hewlett-Packard Company −2− HP-UX 11i Version 3: February 2007
acl(2) acl(2) NAME acl() - set a file’s Access Control List (ACL) information; JFS File Systems only SYNOPSIS #include #include int acl(char *pathp, int cmd, int nentries, struct acl *aclbufp); a DESCRIPTION The acl() system call is used to manipulate ACLs on JFS file system objects. pathp points to a path name 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. a • 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.
acl(2) acl(2) SEE ALSO getacl(1), setacl(1), aclsort(3C), privileges(5).
adjtime(2) adjtime(2) NAME adjtime() - correct the time to synchronize the system clock SYNOPSIS #include int adjtime( const struct timeval *delta, struct timeval *olddelta ); a 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) [EPERM] if the process does not have the appropriate privilege. [EFAULT] The address specified for delta (or olddelta) is invalid. [EINVAL] If delta.tv_sec is greater than 31536000 (approximately 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.
aio_cancel(2) aio_cancel(2) NAME aio_cancel() - cancel an asynchronous I/O operation SYNOPSIS #include int aio_cancel(int fildes, struct aiocb *aiocbp); a 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 #include int aio_fsync(int op, struct aiocb *aiocbp); a 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 #include int aio_read(struct aiocb *aiocbp); a 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_reap(2) aio_reap(2) NAME aio_reap() - wait for multiple asynchronous I/O requests SYNOPSIS #include typedef struct aio_completion_data { struct aiocb *aio_aiocb; int aio_return; int aio_error; } aio_completion_t; int aio_reap(aio_completion_t list[], int nent, *timeout, int waitfor, int *completed_count); a const struct timespec DESCRIPTION The aio_reap() function is an extension of the aio_suspend() library function.
aio_reap(2) aio_reap(2) The timeout parameter must be either NULL or point to a timespec structure that has a timeout time specified. If a NULL pointer is specified, then no timeout handling is performed and aio_reap() blocks until waitfor AIO requests are available. If timeout points to a zero-value timespec structure, aio_reap() returns immediately after checking for any completed AIO requests (behaves similar to poll()) .
aio_reap(2) aio_reap(2) int ignore; (void)aio_reap(NULL, 0, NULL, 0, &ignore); For this single call to initialize aio_reap(), all output (including return value) should be ignored. a RETURN VALUE aio_reap() returns 0 if waitfor or more AIO requests have completed. The reaped requests (the aiocb addresses of the completed AIO requests) are copied to the array list , and the number of AIO requests reaped is returned into the address specified by completed_count.
aio_return(2) aio_return(2) NAME aio_return() - return status of an asynchronous I/O operation SYNOPSIS #include ssize_t aio_return(struct aiocb *aiocbp); a 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 #include int aio_write(struct aiocb *aiocbp); a 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) a 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 #include unsigned int alarm(unsigned int sec); a 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) (TO BE OBSOLETED) 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 Remarks This function is provided purely for backward compatibility. HP recommends that new applications use the audsys command to configure the auditing system. See audsys(1M).
audctl(2) audctl(2) (TO BE OBSOLETED) ignored. The auditing system begins writing to the new "current" file. If the auditing system is off, no action is performed; -1 is returned, and errno is set to EALREADY . If the auditing system is on and there is no available "next" file, no action is performed; -1 is returned, and errno is set to [ENOENT]. The caller issues the AUD_OFF command to halt the auditing system.
audctl(2) audctl(2) (TO BE OBSOLETED) SEE ALSO audomon(1M), audsys(1M), audit(5), privileges(5).
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 users with the SELFAUDIT privilege. One of the following flags must be used for aflag: 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 #include int audwrite(const struct self_audit_rec *audrec_p); a DESCRIPTION audwrite() is called by self-auditing processes, which are capable of turning off the regular auditing using the audswitch() system call (see audswitch(2)) and doing higher-level auditing on their own. audwrite() is restricted to users with the SELFAUDIT privilege.
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) [EAFNOSUPPORT] The specified address is not a valid address for the address family of this socket. [EBADF] s is not a valid file descriptor. [EDESTADDRREQ] No addr parameter was specified. b [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 NFSmounted (remote) name.
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) If the process does not have OBJSUID privilege, and the effective group ID of the process does not match the group ID of the file, and none of the group IDs in the supplementary groups list match the group ID of the file, mode bit S_ISGID is cleared.
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) chown(2) ERRORS If chown() or lchown() fails, errno is set to one of the following values: [EACCES] Search permission is denied on a component of the path prefix. [EFAULT] path points outside the allocated address space of the process. The reliable detection of this error is implementation dependent. [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. The .. entry in the root directory is interpreted to mean the root directory itself. Thus, ..
clocks(2) clocks(2) NAME clock_settime(), clock_gettime(), clock_getres() - clock operations SYNOPSIS #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); c 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. X/Open Sockets Compilation Environment See xopen_networking(7).
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. [ENODEV] The x25ifname field refers to a nonexistent interface.
coreadm(2) coreadm(2) NAME coreadm - application core file administration SYNOPSIS #include int coreadm(int c_version, pid_t core_file_settings_t *c_out); c c_pid, core_file_settings_t *c_in, DESCRIPTION coreadm() system call is used to specify the location and pattern for core files produced by abnormally terminating processes. See core(4). This system call can be used to specify a system wide location for core file placement and/or a process specific pattern.
coreadm(2) c_out coreadm(2) If non-NULL, the current settings are returned in this parameter. RETURN VALUE Upon successful completion, coreadm() returns 0. Otherwise, a value of -1 is returned and errno is set to indicate the error. ERRORS [EPERM] coreadm() fails and does not change the core file settings if the effective user-ID of the calling process is not a user having appropriate privileges. [EFAULT] The input or output parameter passed to coreadm() is an invalid address.
coreadm(2) coreadm(2) fprintf(stderr,"Usage %s \n", argv[0]); exit(2); } bzero(&c_in, sizeof(c_in)); bzero(&c_out,sizeof(c_out)); strcpy(c_in.c_pattern,"core.%p.%t"); c_in.c_flags = COREADM_PROC_ENABLED; /* Read the current settings. */ ret = coreadm(COREADM_VERSION, (pid_t)0, \ (corefile_settings_t *) NULL, &c_out); if (ret) { perror("coreadm"); exit(ret); } if ((c_out.c_flags & COREADM_PROC_ENABLED) == 0) { fprintf(stdout, "Warning: System wide Per-process core file dumping\ currently disabled.
coreadm(2) coreadm(2) if (ret) { perror("coreadm"); exit(ret); } } SEE ALSO coreadm(1M), exec(2), fork(2), pstat(2), ttrace(2), core(4).
crashconf(2) crashconf(2) NAME crashconf() - configure system crash dumps SYNOPSIS #include int crashconf( int operation, int includeClasses, int excludeClasses, int deviceCount, char **devices, int *deviceReturn ); c 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) DC_SETNOCOMPRESS DC_SETCONCURRENT DC_SETNOCONCURRENT DC_PERSISTENT crashconf() will set the compression mode OFF . crashconf() will set the concurrency mode ON. crashconf() will set the concurrency mode OFF . crashconf() will mark the current dump device list as persistent. Once this is used, from the next boot onwards, system will ignore devices lvlnboot , vxvmboot , marked for dump using and /stand/system. Instead, the persistent device list is used.
crashconf(2) DT_USTACK DT_SUPERPG DT_USERPG crashconf(2) User process stack pages Unused Superpage pool pages User process pages Security Restrictions The crashconf() system call is restricted to processes owned by superusers or with the DEVOPS privilege. See privileges(5) for more information about privileged access on systems that support finegrained privileges. c EXAMPLES The following examples demonstrate the usage of crashconf() .
crashconf(2) crashconf(2) int device_return[1]; ... crashconf(DC_DEVICES|DC_REMOVE, 0, 0, 1, device_to_remove, device_return); Example 8: Setting Concurrent Dump ON, Including Kernel Code Pages crashconf(DC_SETCONCURRENT | DC_INCLUDE, DT_KCODE, 0, NULL, NULL); c RETURN VALUE 0 Successful completion. -1 Error. errno is set to indicate the error. 1 If DC_DEVICES is set, 1 indicates that at least one device has been configured but one or more devices failed to configure.
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); c 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) [EMFILE] creat(2) 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. [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( ), ftruncate64( ), 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) creat64(2) creat64() The creat64() function returns a file descriptor which can be used to grow the file past 2 GB if desired. All other functional behaviors, returns, and errors are identical to creat() . 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.
creat64(2) creat64(2) _FILE_OFFSET_BITS is set to 64. The bit may be queried by fcntl() (or fcntl64() ), which can also turn the bit on or off if desired. APPLICATION USAGE The standard POSIX interfaces may be used by 32-bit applications to create and access large files if compiled with _FILE_OFFSET_BITS set to 64. The interfaces described here are alternatives to the standard ones, and are enabled by defining _LARGEFILE64_SOURCE.
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: • 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. d 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) [EMLINK] Too many links. An attempt to make more than the maximum number of links to a file. [EMSGSIZE] Message too long. The socket requires that the message be sent atomically, and the size of the message to be sent made this impossible. [ENAMETOOLONG] 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) while SEM_UNDO flag is set. [ENOSYM] Symbol does not exist in executable. The dynamic loader was unable to resolve a symbolic reference in a shared library during a call to one of the dynamic loader interface routines (see shl_load(3X). The program may be in an inconsistent state and should be terminated immediately. [ENOSYS] Function is not available. The requested function or operation is not implemented or not configured in the system. [ENOTBLK] Block device required.
errno(2) errno(2) [ESPIPE] Illegal seek. An lseek() was issued to a pipe. [ESRCH] No such process. No process can be found corresponding to that specified by pid in kill() or rtprio() , or the process is not accessible. [ETIMEDOUT] Connection timed out. A connect() request failed because the connected party did not properly respond after a period of time (timeout period varies, depending on the communication protocol). [ETXTBSY] Text file busy.
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) arg0, ..., argn are one or more pointers to null-terminated character strings. These strings constitute the argument list available to the new program. By convention, at least arg0 must be present and point to a string identical to path or to path’s last component. argv is an array of character pointers to null-terminated strings. These strings constitute the argument list available to the new program.
exec(2) exec(2) • • • • • signal mask (see sigprocmask(2)) supplementary group IDs time left until an alarm clock signal (see alarm(2)) trace flag (see ttrace(2) request TT_PROC_SETTRC) 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 zero or more spaces, followed by interpreter or interpreter argument, as in: #! interpreter [argument] One or more spaces or tabs must separate in
exec(2) exec(2) [EINVAL] argv points to NULL and null pointer dereferencing is allowed. In this case, NULL is a valid address, but is considered an invalid argument. [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.
exit(2) exit(2) NAME exit(), _exit(), _Exit() - terminate a process SYNOPSIS #include void exit(int status); void _Exit(int status); #include void _exit(int status); Parameters status The values of status can be EXIT_SUCCESS or EXIT_FAILURE , as described in , or any other value, although only the least significant 8 bits (that is, status & 0377 ) are available to a waiting parent process.
exit(2) exit(2) • A SIGCHLD signal is sent to the parent process. • If the calling process is a controlling process, the SIGHUP signal is sent to each process in the foreground process group of the controlling terminal belonging to the calling process. The controlling terminal associated with the session is disassociated from the session, allowing it to be acquired by a new controlling process.
fadvise(2) fadvise(2) NAME fadvise() - file advisory information SYNOPSIS #include #include int fadvise( int fad_fd , off_t fad_offset , size_t fad_len , enum fadv_hints fad_advice , fad_extparms_t *fad_extparms ); f Parameters fad_fd The open file descriptor to which the fadvise operation applies. fad_offset The beginning of the specified range as a positive, byte offset. fad_len The length of the specified range in bytes.
fadvise(2) fadvise(2) alias (see fadvise(5)). The page size specified in the fad_pgsize alias will be rounded down to the supported large page size in the system. If no hint is specified, then the page size specified in the tunable vps_pagesize will be used. FADV_NOREUSE Specifies that the application will expect to access the specified range of data once and then not reuse it thereafter.
fadvise(2) fadvise(2) fad_plistp->fad_advice = FADV_SEQUENTIAL; fad_plistp->FAD_OFFSET = 0; fad_plistp->FAD_LEN = 65536; /* first 64k range */ fad_plistp++; /* Advise that we won’t re-use the data. */ fad_plistp->fad_advice = FADV_NOREUSE; fad_plistp->FAD_OFFSET = 0; fad_plistp->FAD_LEN = 65536; /* first 64k range */ ret = fadvise (fd, 0, 0, 0, my_fad_extparms); if (ret == -1) printf ("fadvise() failure errno %d\n", errno); f AUTHOR fadvise() was derived by HP from the IEEE POSIX 1003.1-2001 Standard.
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. The following are possible values for the cmd argument: F_ADVISE F_DUPFD f Fadvise service request (see fadvise(2)).
fcntl(2) fcntl(2) F_SETLKW64 Same as F_SETLKW , except arg is a pointer to struct flock64 instead of struct flock . F_GETOWN If fildes refers to a socket, fcntl() returns the process or process group ID specified to receive SIGURG signals when out-of-band data is available. Positive values indicate a process ID; negative values, other than -1, indicate a process group ID.
fcntl(2) F_UNSHARE fcntl(2) Removes an existing share reservation. A read lock prevents any other process from write-locking the protected area. More than one read lock can exist for a given segment of a file at a given time. The file descriptor on which a read lock is being placed must have been opened with read access. A write lock prevents any other process from read-locking or write-locking the protected area. Only one write lock may exist for a given segment of a file at a given time.
fcntl(2) fcntl(2) The following arguments are supported for oplocks. F_SETOPLOCK Requests an opportunistic lock reservation (oplock) on a file. The supported oplock types are defined in . F_SETOPLOCKW Requests an opportunistic lock reservation (oplock) on a file and will wait (in other words, block) until the request may be granted. F_REMOVEOPLOCK F_HAVEOPLOCK Removes all oplocks by pid. Checks to see if an oplock is present on a file.
fcntl(2) fcntl(2) Application Usage Because in the future the external 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: flk->l_type = F_RDLCK; if (fcntl(fd, F_SETLK, flk) == -1) if ((errno == EACCES) || (errno == EAGAIN)) /* * section locked by another process, * check for either EAGAIN or EACCES * due to different implementations */ else if ...
fcntl(2) F_UNSHARE fcntl(2) Value other than −1. Otherwise, a value of −1 is returned and errno is set to indicate the error.
fcntl(2) fcntl(2) [EOVERFLOW] cmd is F_GETLK and the blocking lock’s starting offset or length would not fit in the caller’s structure. [EPERM] cmd is F_SETTIMES and the user does not have superuser privilege. [EWOULDBLOCK] cmd is F_ADVISE the hint is FADV_WILLNEED and VM has detected a blocking condition. WARNINGS Oplock support is release specific and as such is not guaranteed to be supported in future releases and/or with the same interface.
flock(2) flock(2) NAME flock() - apply or remove an advisory or enforced lock on an open file SYNOPSIS #include int flock( int filedes , int operation ); Parameters filedes Specifies a file descriptor returned by a successful open() , creat() , dup() , dup2 , or fcntl() function, identifying the file on which the locking operation is to be performed. operation Specifies one of the following constants for flock() , defined in the
flock(2) flock(2) File locking as implemented for NFS files is only advisory. RETURN VALUES flock() returns: 0 for successful completion -1 for unsuccessful completion; errno is set to indicate the error ERRORS If the flock() function fails, errno may be set to one of the following values: [EBADF] The filedes parameter is not a valid open file descriptor. A shared lock was requested and filedes was not opened for reading, or an exclusive lock was requested and filedes was not opened for writing.
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 with 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) Fine-grained privileges are inherited through a calculation to determine which, if any, of the parent process’ privileges are inherited by the child. The vfork () system call can be used to fork processes more quickly than fork() , but has some restrictions. See vfork(2) for details. 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.
fsctl(2) fsctl(2) NAME fsctl - file system control SYNOPSIS #include int fsctl( int fildes, int command, void *outbuf, size_t outlen ); f 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 sys/cdfsdir.h).
fsctl(2) fsctl(2) length of 129 can be used for outlen and the size of outbuf. 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
fstat(2) fstat(2) NAME fstat() - get file status SYNOPSIS #include #include int fstat(int fildes, struct stat *buf); f 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. fildes is a file descriptor for an open file, which is created with the successful completion of an open() , creat() , dup() , fcntl() , or pipe() system call.
fstat(2) fstat(2) 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.
fstat(2) fstat(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), fstat64(2), link(2), lstat(2), mknod(2), pipe(2), read(2), rename(2), setacl(2), sysfs(2), time(2), truncate(2), unlink(2), utime(2), write(2), acl(5), aclv(5), stat(5), , .
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) 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 described in Security Restrictions) or users with DAC_READ
getaccess(2) getaccess(2) [ENOTDIR] A component of the path prefix is not a directory. [EOPNOTSUPP] getaccess () is not supported on some types of remote files. EXAMPLES The following call determines the caller’s effective access rights to file test and succeeds if the user has read access: #include #include int mode; mode = getaccess ("test", UID_EUID, NGROUPS_EGID_SUPP, (int *) 0, (void *) 0, (void *) 0); if ((mode >= 0) && (mode & R_OK)) ...
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) [ENOSYS] The function is not supported by this file system type. [ENFILE] The system file table is full. EXAMPLES The following call returns the number of entries in the ACL on file /users/bill/mcfile. #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
getaudid(2) getaudid(2) (TO BE OBSOLETED) NAME getaudid() - get the audit ID (aid) for the current process SYNOPSIS #include int getaudid(void); Remarks This function is provided purely for backward compatibility. HP recommends that new applications use getauduser() instead. See getauduser(3). DESCRIPTION getaudid() returns the audit ID (aid) for the current process. This call is restricted to users with the SELFAUDIT privilege.
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 users with the SELFAUDIT privilege.
getcontext(2) getcontext(2) (DEPRECATED) NAME getcontext(), setcontext() - get and set current user context; DEPRECATED SYNOPSIS #include int getcontext(ucontext_t *ucp); int setcontext(const ucontext_t *ucp); Remarks getcontext() and setcontext() are deprecated. See the WARNINGS section. 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 For versions prior to 10.30 #include For 10.30 and later versions 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(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. Note: The getdirentries() call can encounter truncated d_ino values when it is used with a 64-bit filesystem. 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 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.
getdtablesize(2) getdtablesize(2) NAME getdtablesize() - get the size of the per-process file descriptor table SYNOPSIS #include int getdtablesize(void); DESCRIPTION The getdtablesize() function returns the maximum number of file descriptors that can currently be stored in a process’ file descriptor table. This maximum number is also known as the soft limit for open files, and can be adjusted up to the hard limit by calling setrlimit() .
getevent(2) getevent(2) (TO BE OBSOLETED) 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 ); Remarks This function is provided purely for backward compatibility. HP recommends that new applications use the audevent command to get events and system calls that are currently being audited. See audevent(1M).
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. As a special case, if the ngroups argument is zero, getgroups() returns the number of group entries for the process.
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. g 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 system 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 system 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 and 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 ); g DESCRIPTION The getitimer() function stores the current value of the timer specified by which into the structure pointed to by value.
getitimer(2) timerisset timercmp getitimer(2) Test if a time value is non-zero. Compare two time values. (Beware that >= and <= do not work with the timercmp macro.) The timer used with ITIMER_REAL is also used by alarm() (see alarm(2)). Thus successive calls to alarm() , getitimer() , and setitimer() set and return the state of a single timer. In addition, a call to alarm() sets the timer interval to zero. The interaction between setitimer() and any of alarm() , sleep() or usleep() is unspecified.
getksym(2) getksym(2) NAME getksym() - get information for local and global kernel symbols SYNOPSIS #include #include #include #include /* For STT_PARISC_MILLI on PA-RISC */ int getksym(char * symname, char * modname, uint64_t *value, uint64_t *info); DESCRIPTION There are two ways that getksym() can be used to retrieve kernel symbol information.
getksym(2) getksym(2) [ENAMETOOLONG] modname is greater than MODMAXNAMELEN characters long, or symname is greater than MAXSYMNMLEN characters long. [ENOMATCH] The symbol name given is not found, or the value given is not a currently valid address. EXAMPLES The following code sequence and call to getksym() obtains a symbol name (and an offset) given an address. #include #include #include
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. g 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) should follow the X/Open specification (see xopen_networking(7)). WARNINGS Linking binary objects compiled to X/Open Sockets specification and binary objects compiled to HP-UX BSD Sockets specification to the same executable may result in unexpected behavior, including application abnormal termination and unexpected socket errors. See xopen_networking(7) for details and remedy.
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) [EACCES] The calling process does not have access rights to change one or more of the indicated processes. All processes for which access is allowed are still affected. [EINVAL] which is not one of the choices listed above, or who is out of range. [EPERM] The calling process attempted to change the priority of a process to a smaller priority value without having appropriate privileges. [ESRCH] Processes indicated by which and who cannot be found.
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); g 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) [E2BIG] The request would require assigning privileges to more than PRIV_MAXGRPS groups. [EFAULT] mask points to an illegal address. The reliable detection of this error is implementation dependent. [EINVAL] mask has bits set for one or more unknown privileges. [EINVAL] grpid is out of range. [EPERM] The caller is not a privileged user.
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) getrlimit(2) fail with the effects outlined above. RLIMIT_AIO_OPS This is the maximum number of POSIX Asynchronous I/O operations that a process can have enqueued simultaneously. If this limit is exceeded, the aio_read() , aio_write() , and lio_listio() functions will fail with errno set to [EAGAIN]. RLIMIT_AIO_MEM This is the maximum number of bytes of memory that can be locked simultaneously by POSIX Asynchronous I/O requests from a single process.
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. Security Restrictions The actions associated with this system call are subject to compartmental restrictions.
getsockname(2) getsockname(2) NAME getsockname - get socket address SYNOPSIS #include AF_CCITT Only #include
getsockname(2) getsockname(2) such migration problems. On the other hand, applications that need to be portable to the UNIX 95 profile should follow the X/Open specification (see xopen_networking(7)). WARNINGS Linking binary objects compiled to X/Open Sockets specification and binary objects compiled to HP-UX BSD Sockets specification to the same executable may result in unexpected behavior, including application abnormal termination and unexpected socket errors.
getsockopt(2) getsockopt(2) NAME getsockopt(), setsockopt() - get and set options on sockets SYNOPSIS #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 nonzero (set). The value of other options depends on the purpose of the option.
getsockopt(2) getsockopt(2) (default buffer size: 2147483647 bytes; maximum buffer size: 2147483647 bytes; udp maximum receive buffer size can be lowered using the ndd parameter udp_recv_hiwater_max). 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() .
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) passing a size_t pointer will evoke compile-time warnings, which must be corrected in order for the application to behave correctly. Applications that use socklen_t now, where appropriate, will avoid such migration problems. On the other hand, applications that need to be portable to the UNIX 95 profile should follow the X/Open specification (see xopen_networking(7)).
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 Epoch, and stores it in the timeval structure pointed to by tp. The resolution of the system clock is one microsecond. PARAMETERS Programs should use this time zone information only in the absence of the TZ environment variable.
gettimeofday(2) gettimeofday(2) WARNINGS Relying on a granularity of one microsecond may result in code that is not portable to other platforms. AUTHOR gettimeofday() was developed by the University of California, Berkeley, and HP. SEE ALSO date(1), ftime(2), settimeofda(2), stime(2), time(2), ctime(3C).
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() g Real-user-ID of the calling process. Effective-user-ID of the calling process. 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) AUTHOR ioctl() was developed by AT&T and HP. SEE ALSO ioctl(5), privileges(5), arp(7P), socket(7), termio(7).
iscomsec(2) iscomsec(2) (TO BE OBSOLETED) NAME iscomsec() - check if 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() or 0. The raise() system call sends a signal to the executing process or thread.
kill(2) kill(2) RETURN VALUE Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error. ERRORS If kill() fails, no signal is sent. errno is set to one of the following values. [EINVAL] sig is neither a valid signal number nor zero. [EINVAL] sig is SIGKILL or SIGSTOP and pid is that of the initialization process (also known as init ).
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.
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.
listen(2) listen(2) SEE ALSO accept(2), connect(2), socket(2), thread_safety(5), xopen_networking(7), inet(7F).
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 ); PARAMETERS The parameters for the lstat() 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. buf is a pointer to a stat structure where the file status information is stored.
lstat(2) lstat(2) RETURN VALUE Upon successful completion, lstat() returns 0. Otherwise, it returns −1 and sets errno to indicate the error. ERRORS The lstat() function will fail if: [EACCES] A component of the path prefix denies search permission. [ELOOP] Too many symbolic links were encountered in resolving path. [ENAMETOOLONG] The length of a pathname exceeds {PATH_MAX} , or the pathname component is longer than {NAME_MAX} . [ENOTDIR] A component of the path prefix is not a directory.
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, an anonymous memory region, or a shared memory region. Certain implementations can use this information to optimize the use of resources.
madvise(2) [EINVAL] madvise(2) The address range specified by addr and len was not created by a successful call to mmap() or shmat() . AUTHOR madvise() was developed by HP and OSF. SEE ALSO mmap(2), sysconf(2).
makecontext(2) makecontext(2) (DEPRECATED) NAME makecontext(), swapcontext() - manipulate user contexts; DEPRECATED SYNOPSIS #include void makecontext(ucontext_t *ucp, (void *func)(), int argc, ...); int swapcontext(ucontext_t *oucp, const ucontext_t *ucp); Remarks makecontext() and swapcontext() are deprecated. See the WARNINGS section. DESCRIPTION The makecontext() function modifies the context specified by ucp, which has been initialized using getcontext() .
memcntl(2) memcntl(2) NAME memcntl() - memory management control SYNOPSIS #include #include int memcntl( caddr_t addr , size_t len , int cmd , caddr_t arg , int attr , int mask ); Parameters addr A multiple of page size as returned by the sysconf() routine where implemented; otherwise, addr must contain the value NULL. Where used, control operations can be further defined with the bit pattern contained in attr. len Must be 0 for the MC_LOCKALL and MC_UNLOCKALL operations.
memcntl(2) memcntl(2) A single unlock operation removes multiple lock operations that occur on a page with the same address in the same process. If a page is locked in one process, but mapped in another, or visible through a different mapping in the locking process, the lock remains in memory until the locking process completes an either implicit or explicit unlock operation. Removing a locked mapping or deleting a page through file removal or truncation causes an implicit unlock operation.
memcntl(2) [EPERM] memcntl(2) The effective user ID of the process is not superuser and MC_LOCK or MC_UNLOCK was specified. AUTHOR memcntl() was developed by HP. SEE ALSO mlock(2), mlockall(2), mmap(2), mprotect(2), msync(2), plock(2), sysconf(2).
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) [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] 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. AUTHOR mkdir() was developed by the University of California, Berkeley.
mknod(2) mknod(2) NAME mknod() - make a 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.
mlock(2) mlock(2) STANDARDS CONFORMANCE mlock() : POSIX Realtime Extensions, IEEE Std 1003.
mlockall(2) mlockall(2) NAME mlockall() - lock a process virtual address space in memory SYNOPSIS #include int mlockall( const 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.
mlockall(2) mlockall(2) STANDARDS CONFORMANCE mlockall() : POSIX Realtime Extensions, IEEE Std 1003.
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 The mmap() function establishes a mapping between a process’ address space and a file.
mmap(2) MAP_GLOBAL MAP_IO MAP_MEM_INTERLEAVED MAP_MEM_LOCAL MAP_MEM_FIRST_TOUCH mmap(2) Allocate physical memory from the global quadrant / octant. Create a virtual mapping for a physical I/O address range. Physical memory will be interleaved. Allocate physical memory from the current locality domain. Allocate physical memory from the locality domain of the first processor to touch each address. The MAP_PRIVATE and MAP_SHARED flags control the visibility of write references to the memory region.
mmap(2) mmap(2) include, in any unmapping operation, any partial page specified by the range [pa, pa+len]. The MAP_FILE and MAP_ANONYMOUS flags control whether the region to be mapped is a mapped file region or an anonymous shared memory region. Exactly one of these flags must be selected. If MAP_FILE is set in flags, a new mapped file region is created, mapping the file associated with fildes. off specifies the file byte offset at which the mapping starts.
mmap(2) mmap(2) the mpctl(2) manual page. These flags are hints to the system. If memory of the desired type is not available, the next most suitable memory is returned instead. mmap() cannot create a mapped file region unless the file descriptor used to map the file is open for reading. For a mapped file region that is mapped with MAP_SHARED , mmap() grants write access permission only if the file descriptor is open for writing.
mmap(2) mmap(2) RETURN VALUE Upon successful completion, mmap() returns the address, (pa), at which the mapping was placed. Otherwise, it returns MAP_FAILED (defined in ) and sets errno to indicate the error. ERRORS The mmap() function will fail if: [EBADF] The fildes argument is not a valid open file descriptor.
mmap(2) mmap(2) This implies the following: • Any single range of a file cannot be mapped multiple times into different virtual address ranges.
mmap(2) mmap(2) fildes = open(...) address = mmap(0, len, PROT_READ, MAP_PRIVATE, fildes, some_offset) /* use data at address */ AUTHOR mmap() was developed by HP, AT&T, and OSF. SEE ALSO setmemwindow(1M), creat64(2), exec(2), fcntl(2), fork(2), lockf(2), madvise(2), mpctl(2), mprotect(2), msem_init(2), msem_lock(2), msem_unlock(2), msync(2), munmap(2), open(2), pset_ctl(2), shmop(2), sysconf(2), truncate(2), mman(5), privileges(5), stat(5), zero(7). Adaptive Address Space Whitepaper in http://www.hp.
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 kcmodule(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 path name.
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 processes 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 modstat() allows processes to get information for dynamically loaded kernel modules. For processes with appropriate privilege, it fills in all the elements of the modstatus structure, specified by stbuf, with the information available for the given module identifier module_id.
modstat(2) modstat(2) 0 Success. -1 Failure. It sets errno to indicate the error. ERRORS modstat() sets errno to one of the following values if the corresponding condition is detected. [EINVAL] module_id does not match any loaded or registered module when get_next_module is FALSE or module_id is greater than the identifier for any loaded module when get_next_module is TRUE. [ENOSYS] The Dynamically Loadable Kernel Module feature is not initialized. SEE ALSO kcmodule(1M), modload(2), privileges(5).
moduload(2) moduload(2) NAME moduload - unload a kernel module on demand SYNOPSIS #include int moduload(long module_id ); DESCRIPTION moduload allows processes 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) flags points to a bit map that sets options. The following values of the bits are defined in : MS_DELAY Writes to disks are to be delayed until the buffer needs to be reused. This is the default. MS_BEHIND Writes to disks are to be done asynchronously, where possible, without waiting for completion. 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.
mount(2) mount(2) SEE ALSO mount(1M), sysfs(2), umount(2), privileges(5).
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) The mpctl() call is expected to be used to increase performance in certain applications, but should not be used to ensure correctness of an application. Specifically, cooperating processes/lightweight processes should not rely on processor or locality domain assignment in lieu of a synchronization mechanism (such as semaphores). Machine Topology Information Warning: Processor and locality domain IDs are not guaranteed to exist in numerical order.
mpctl(2) mpctl(2) Warning: The information returned by this system call may be out-of-date arbitrarily soon after the call completes due to the scheduler context switching the caller onto a different ldom. MPC_LDOMSPUS_SYS This request returns the number of enabled processors in the locality domain ldom. The pid argument is ignored. MPC_SPUTOLDOM This request returns the ID of the locality domain containing processor spu. The pid argument is ignored.
mpctl(2) mpctl(2) Logical Processor and Processor Core Information On systems with Hyper-Threading (HT) feature enabled, each processor core may have more than one hyper-thread per physical processor core. When hyper-threading is enabled at the firmware level, each hyper-thread is represented to the operating system and applications as a logical processor (LCPU). Hence the basic unit of any topology information is a logical processor.
mpctl(2) mpctl(2) However, if any LWP belongs to a different processor set such that the specified processor or locality domain does not contribute to that processor set, the binding assignment for such an LWP is not changed. When a process creates another process (via fork() or vfork() ), the child process will inherit the parent process’s binding assignments (NOT the binding assignments of the creating LWP).
mpctl(2) mpctl(2) The lwpid MPC_SELFLWPID may be used to refer to the calling LWP. The spu MPC_SPUNOCHANGE may be passed to read the current assignment. The spu MPC_SPUFLOAT may be used to break any specific-processor assignment. This allows the LWP to float to any processor. NOTE: This call is advisory. If the scheduling policy for a LWP conflicts with this processor assignment, the scheduling policy takes precedence.
mpctl(2) mpctl(2) When a processor is ready to choose another LWP to execute, and the highest priority SCHED_FIFO LWP is bound to a processor in a different locality domain, that LWP will not be selected to execute on the selecting processor, but instead will wait for a processor on the locality domain to which it was bound. The selecting processor will then choose a lower priority LWP to execute on the processor. NOTE: This option will not guarantee compliance with POSIX real-time scheduling algorithms.
mpctl(2) mpctl(2) When setting a launch policy, if the target already has processor or locality domain binding, the existing binding will not be overwritten. Instead the locality domain in which the target is bound (whether locality domain binding or processor binding) will be used as the starting locality domain for implementing the launch policy. When setting a process launch policy, the launch policy specified shall only be applied to the process.
mpctl(2) mpctl(2) policies may be added in future releases and returned via this option. Applications using this option should be written to handle other return values in order to continue working on future releases. The ldom argument is ignored. MPC_SETPROCESS_RR This call establishes a round robin launch policy (MPC_LAUNCH_POLICY_RR) for the specified process.
mpctl(2) mpctl(2) MPC_SETLWP_RR This call establishes a round robin launch policy (MPC_LAUNCH_POLICY_RR) for the specified LWP. The successive child LWPs are launched on different locality domains in a round robin manner until all available locality domains have been used by LWPs in the launch tree. At that point, the selection of locality domains begins again from the original locality domain. The ldom argument is ignored.
mpctl(2) mpctl(2) [EINVAL] request is MPC_GETNEXTSPU or MPC_GETNEXTSPU_SYS and spu identifies the last processor. Or request is MPC_GETNEXTLDOM or MPC_GETNEXTLDOM_SYS and ldom identifies the last locality domain. [ESRCH] pid or lwpid identifies a process or LWP that does not exist. [EACCES] pid or lwpid identifies a process or LWP that is not visible to the calling thread.
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) STANDARDS CONFORMANCE mprotect() : AES, SVID3 m HP-UX 11i Version 3: February 2007 −2− Hewlett-Packard Company 225
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 or 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 or 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 path name component consisting of a dot or dot-dot. For example, /./tmp and /../tmp are invalid. c. Contain no illegal characters. d. Contain no path name components longer that _POSIX_NAME_MAX. e. Entire name should not be longer that _POSIX_PATH_MAX. To use this function, link in the realtime library by specifying -lrt on the compiler or linker command line.
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) [EINVAL] msqid is not a valid message queue identifier. [EINVAL] cmd is not a valid command, or the command contains invalid parameters. [EACCES] cmd is equal to IPC_STAT and Read operation permission is denied to the calling process (see message operation permissions in glossary(9)). [EPERM] cmd is equal to IPC_RMID or IPC_SET and the calling process does not have the OWNER privilege or the effective user ID of the calling process is not equal to the value of either msg_perm.
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.
msgget(2) [EEXIST] msgget(2) A message queue identifier exists for key but ( (msgflg & IPC_CREAT ) && (msgflg & IPC_EXCL ) ) is "true". SEE ALSO ipcrm(1), ipcs(1), msgctl(2), msgop(2), stdipc(3C), privileges(5).
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) [EACCES] [EAGAIN] msgop(2) 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 the memory of a mapped file with physical storage SYNOPSIS #include int msync( void *addr , size_t len , int flags ); Parameters addr With len, specifies the region to be synchronized. len With addr, specifies the region to be synchronized. flags Specifies one of the following values: MS_ASYNC Performs asynchronous writes. The function synchronizes the file contents to match the current contents of the memory region.
msync(2) msync(2) Performance Considerations The following performance considerations only apply when using the MS_INVALIDATE option with msync() . These performance constraints do not apply when either MS_ASYNC or MS_SYNC are exclusively used with msync() . Direct read/write references to portions of a mapped memory region currently undergoing an msync() operation (with MS_INVALIDATE specified), may be blocked until all scheduled write operations are completed.
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 behavior is undefined.
mvalid(2) mvalid(2) NAME mvalid() - check memory region for validity SYNOPSIS #include #include int mvalid( caddr_t addr , size_t len , int prot ); Parameters addr The address of the region whose validity is to be checked. len The length in bytes of the region specified by the addr parameter. prot The desired access protection for the region. DESCRIPTION The mvalid() function checks the validity of a memory region.
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 thread 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 thread 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). 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) too are the same as their image on disk. RETURN VALUE open() returns the following values: 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.
open(2) [ETXTBSY] open(2) The file is open for execution and oflag is write or read/write. Normal executable files are only open for a short time when they start execution. Other executable file types can be kept open for a long time, or indefinitely under some circumstances. EXAMPLES The following call to open() opens file inputfile for reading only and returns a file descriptor for inputfile . For an example of reading from file inputfile , see the read(2) manual entry.
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) 8. pathconf(2) _POSIX_CHOWN_RESTRICTED is defined if the privilege group PRIV_GLOBAL has been granted the CHOWN 9. privilege (see getprivgrp (2) and chown(2)). In all other cases, _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.
pathconf(2) pathconf(2) fprintf(stderr, "Filename %s too long.\n", filebuf); /* take error action */ } else if (errno) { perror("pathconf"); /* take error action */ } } /* 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.
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).
pipe(2) pipe(2) [EMFILE] NFILE-1 or more file descriptors are currently open. [ENFILE] The system file table is full. [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), privileges(5), streampipes(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 equal to TXTSHLIBLOCK and a text lock or process lock already exists on the calling process. [EINVAL] op is equal to DATSHLIBLOCK and a data lock, or process lock already exists on the calling process. [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.
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) POLLWRNORM POLLWRBAND Same as POLLOUT POLLMSG A M_SIG or M_PCSIG message specifying SIGPOLL has reached the front of the stream head read queue. Priority data (priority band > 0) can be written without being blocked by flow control. Only previously written bands are checked. 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.
poll(2) poll(2) fds.fd = 0; fds.events = POLLNORM; poll(&fds, 1, -1); Wait for input on ifd1 and ifd2 , output on ofd , giving up after 10 seconds: #include struct pollfd fds[3]; int ifd1, ifd2, ofd, count; fds[0].fd = ifd1; fds[0].events = POLLNORM; fds[1].fd = ifd2; fds[1].events = POLLNORM; fds[2].fd = ofd; 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].
posix_fadvise(2) posix_fadvise(2) NAME posix_fadvise(), posix_fadvise64() - file advisory information SYNOPSIS #include int posix_fadvise( int fd , off_t offset , off_t len , int advice ); int posix_fadvise64( int fd , off_t offset , off_t len , int advice ); Parameters fd The open file descriptor to which the fadvise operation applies. offset The begining of the specified range as a positive, byte offset. len The length of the specified range in bytes.
posix_fadvise(2) posix_fadvise(2) ERRORS If the posix_fadvise() service fails, errno is set to one of the following values: [EBADF] The fd argument is not a valid file descriptor. [ESPIPE] The fd argument is associated with a pipe or FIFO. [ENOTTY] The posix_fadvise operation is not supported by the underlying file system. [EINVAL] The value of advice or one of the other input values has been found to be invalid. [ENOSYS] A designated hint is not supported by the underlying file object.
postwait(2) postwait(2) NAME postwait: pw_getukid(), pw_wait(), pw_post(), pw_postv(), pw_getvmax() - lightweight synchronization mechanism SYNOPSIS #include #include
postwait(2) postwait(2) [EFAULT] ts points to an illegal address. The reliable detection of this error is implementation dependent. [EINTR] pw_wait() was interrupted by a signal. [EINVAL] The timespec pointed to by ts is invalid. pw_post() sets errno to one of the following values if it fails: [EINVAL] The ukid refers to a non-existent kernel thread. pw_postv() sets errno to one of the following values if it fails: [EFAULT] targets points to an illegal address.
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) When a processor core is assigned to another pset, depending on the source and target processor sets’ PSET_ATTR_LCPU (see pset_setattr (2)) value, the number of logical processors from that processor core may change. EXAMPLES Reassign spu from its current processor set to new_pset, and retrieve the current processor set in old_pset. #include spu_t spu; psetid_t new_pset, old_pset; int ret; /* * Initialize spu and new_pset first.
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) If pset is empty (no processors are assigned as yet), the behavior of pset_bind() function depends on the value of PSET_ATTR_EMPTY attribute. The default behavior on an attempt to bind a thread or a process to an empty processor set is to fail the request. The child process and its first thread created by a fork() or vfork() function inherits the processor set binding from the parent process.
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) not the processor cores in a processor set are enabled with logical processors (LCPU). By default, the default processor set’s PSET_ATTR_LCPU attribute value is inherited at the time of creation. The non-default processor set’s PSET_ATTR_LCPU can be modified by pset_setattr(), but the default processor set’s PSET_ATTR_LCPU can only be modified by the dynamic kernel tunable command, kctune .
pset_create(2) pset_create(2) [ENOMEM] A new processor set cannot be created at this time due to lack of necessary system resources. [ENOSYS] The processor set functionality is not supported by the underlying HP-UX version. SEE ALSO kctune(1M), psrset(1M), pset_assign(2), pset_bind(2), pset_ctl(2), pset_setattr(2), rtsched(2), sysconf(2), privgrp(4), privileges(5).
pset_ctl(2) pset_ctl(2) NAME pset_ctl - processor set control SYNOPSIS #include int pset_ctl( pset_request_t request , pset , psetid_t id id_t ); 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. Logical Processor and Processor Core Information On systems with the Hyper-Threading (HT) feature enabled, each processor core may have more than one hyper-thread per physical processor core.
pset_ctl(2) pset_ctl(2) /* Get total count of processor sets in the system */ pset_count = pset_ctl(PSET_GETNUMPSETS, 0, 0); if (pset_count < 1) { perror("pset_ctl(PSET_GETNUMPSETS)"); exit(1); } all_psets = (psetid_t *) malloc(sizeof(psetid_t)*pset_count); memset(all_psets, 0, sizeof(psetid_t)*pset_count); idx = 0; /* Get first processor set */ pset = pset_ctl(PSET_GETFIRSTPSET, 0, 0); if (pset < 0) { perror("pset_ctl(PSET_GETFIRSTPSET)"); exit(2); } all_psets[idx++] = pset; /* Get remaining processor se
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) RETURN VALUE pset_destroy returns zero on successful completion. Otherwise, -1 is returned and errno is set to indicate the error. ERRORS pset_destroy fails if one or more of the following is true: [EBUSY] The attribute value for the processor set does not allow deletion of a non-empty processor set. [EINTR] The operation was interrupted. [EINVAL] pset is not a valid processor set.
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) PSET_OWNER_EXEC The processor set owner has EXEC access. PSET_OWNER_READ The processor set owner has READ access. PSET_OWNER_WRITE The processor set owner has WRITE access. A newly created processor set by default has READ and EXEC access for everyone, but WRITE access only for the processor set owner. A user with the PSET privilege or the pset owner may change the value of the PSET_ATTR_PERM attribute.
pset_getattr(2) pset_getattr(2) PSET_ATTRVAL_DFLTPSET Assign the processor to the specified processor set, and migrate all threads and processes to the system default processor set PS_DEFAULT . This is the default value for this attribute. A user with the PSET privilege or a user with WRITE permissions may change the value of the PSET_ATTR_LASTSPU attribute.
pstat(2) pstat(2) NAME pstat: pstat_getcommandline(), pstat_getcrashdev(), pstat_getcrashinfo(), pstat_getdisk(), pstat_getio(), pstat_getdynamic(), pstat_getfile2(), pstat_getfiledetails(), pstat_getipc(), pstat_getlv(), pstat_getlwp(), pstat_getmpathname(), pstat_getmsg(), pstat_getnode(), pstat_getpathname(), pstat_getpmq(), pstat_getproc(), pstat_getprocessor(), pstat_getprocvm(), pstat_getpsem(), pstat_getpset(), pstat_getsem(), pstat_getshm(), pstat_getsocket(), pstat_getstable(), pstat_getstatic(),
pstat(2) pstat(2) Context Static Dynamic VM IPC Stable Store Crash Dumps Processor Disk IO Object Swap Dump Areas Node Locality Command Line Process LW Process Process VM Process Loc.
pstat(2) pstat(2) In general, no attempt is made to provide consistency between two instances of pstat contexts. This is true even if these two instances are obtained via the same pstat_get*() call. It is also true that two pstat function calls that return the same instance of a pstat context may not be consistent with each other due to changes in the kernel data that occurred between the two calls.
pstat(2) pstat(2) int pid ); Description pstat_getcommandline() returns the command line of the process specified in the pid parameter. Up to a maximum of elemsize -1 bytes is returned in the buffer buf, if the elemsize is less than or equal to the size of the process command line. If the elemsize is greater than the size of process command line, only the available number of bytes are returned. Up to a maximum of 1020 characters of the process command line is stored. The elemcount parameter must be 1.
pstat(2) pstat(2) Description pstat_getdisk() returns information specific to a particular disk. There is one instance of this context for each disk opened in the system. Unused, closed disks may not have a context and the number of contexts may not match the number of disks configured into the system. For each instance requested, up to a maximum of elemsize bytes of data is returned in the pst_diskinfo structures pointed to by buf.
pstat(2) pstat(2) size_t elemsize , size_t elemcount , int index , pid_t pid ); Description pstat_getfile2() returns information specific to a particular open file for a specified process. For the specified process, there is one instance of this context for each open file descriptor. For each instance requested, up to a maximum of elemsize bytes of data is returned in the pst_fileinfo2 structures pointed to by buf.
pstat(2) pstat(2) size_t elemsize , size_t elemcount , int index ); Description pstat_getipc() returns information about the System V IPC subsystem. There is one global instance of this context. This data may change while the system is running due to administrative changes in the associated kernel tunables. Up to a maximum of elemsize bytes of data is returned in the pst_ipcinfo structure pointed to by buf. The elemcount parameter must be 1. The index parameter must be 0.
pstat(2) pstat(2) If pid is set to -1 and elemcount is greater than 0, elemcount entries of system LWP information are returned to the caller program. If pid is greater than or equal to 0 and elemcount is greater than 0, elemcount entries of LWP info within the process specified by pid are returned. As a shortcut, information about a single LWP can be obtained by setting elemcount to 0 and setting index to the TID (Thread ID) of that LWP within its process.
pstat(2) pstat(2) size_t elemcount , int index ); Description pstat_getmsg() returns information specific to a particular System V message queue. There is one instance of this context for each System V message queue on the system. For each instance requested, up to a maximum of elemsize bytes of data is returned in the pst_msginfo structures pointed to by buf. The elemcount parameter specifies the number of pst_msginfo structures that are available at buf to be filled in.
pstat(2) pstat(2) PSTAT FUNCTION Name pstat_getpmq() - get information for a POSIX message queue Synopsis #include int pstat_getpmq( struct pst_pmqinfo *buf, size_t elemsize , size_t elemcount , int index ); Description pstat_getpmq() returns information specific to a particular POSIX message queue. There is one instance of this context for each POSIX message queue on the system.
pstat(2) pstat(2) PSTAT FUNCTION Name pstat_getproclocality() - get information for a process’s memory placement for each locality Description See the pstat_getlocality(2) manpage for the synopsis and full description. PSTAT FUNCTION Name pstat_getprocvm() - get information for a process’s address space Synopsis #include
pstat(2) pstat(2) Synopsis #include int pstat_getpset( struct pst_pset *buf, size_t elemsize , size_t elemcount , int index ); Description pstat_getpset() returns information specific to a particular processor set. There is one instance of this context for each processor set on the system. For each instance requested, up to a maximum of elemsize bytes of data is returned in the pst_pset structure pointed by buf.
pstat(2) pstat(2) PSTAT FUNCTION Name pstat_getsocket() - get detailed information for a socket Synopsis #include int pstat_getsocket( struct pst_socket *buf, size_t elemsize , struct pst_fid *fid ); Description pstat_getsocket() returns detailed information specific to a socket. For the specified socket, there is one instance of this context. For each call, up to a maximum of elemsize bytes of data is returned in the pst_socket structure pointed to by buf.
pstat(2) pstat(2) ); Description pstat_getstatic() returns information about the system. Although this data usually does not change frequently, it may change while the system is running due to manually or automatically generated administrative changes in the associated kernel tunables, online addition/deletion of resources, or other events. There is one global instance of this context. Up to a maximum of elemsize bytes of data is returned in the pst_static structure pointed to by buf.
pstat(2) pstat(2) buf to be filled in. The index parameter specifies the starting index within the context of swap areas. PSTAT FUNCTION Name pstat_getvminfo() - get information about the virtual memory subsystem Synopsis #include int pstat_getvminfo( struc t pst_vminfo * buf , size_t elemsize , size_t elemcount , int index ); Description pstat_getvminfo() returns information about the virtual memory subsystem. There is one global instance of this context.
pstat(2) pstat(2) data. The only candidate fields to have resulted in this condition are those fields with validity macros explicitly defined in the corresponding pst_* data structure. The other fields within that particular structure need not be checked using this method. See also the ERRORS section below. ERRORS If a pstat function fails, errno is set to one of the following values. If an underlying function fails, errno may be set to a value not specified here; see errno(2) for such errors.
pstat(2) pstat(2) [EOVERFLOW] For pstat_getpathname(), the elemcount parameter is not 1 greater than the length of the path name to be returned. [ESRCH] The process in question was not found or was exiting. For pstat_getlv(), pstat_getmsg(), pstat_getproc(), pstat_getprocvm(), pstat_getpset(), pstat_getsem(), or pstat_getshm(), elemcount was 0, specifying the single-item short-cut, and no item matched the selection criteria in index. For example, PID for pstat_getproc().
pstat(2) pstat(2) (void)printf("total execs for the system were %llu\n", total_execs); } else perror("pstat_getprocessor"); } else perror("pstat_getdynamic"); } Example 3A Get dynamic information about the amount of virtual memory actively in use on the system. main() { struct pst_dynamic psd; (void)memset(&psd,0,sizeof(struct pst_dynamic)); if (pstat_getdynamic(&psd, sizeof(psd), (size_t)1, 0) == 1) { (void)printf("total active virtual memory for the system %lld\n", psd.
pstat(2) pstat(2) for (i = 0; i < count; i++) { (void)printf("pid is %lld, command is %s\n", pst[i].pst_pid, pst[i].pst_ucomm); } /* * now go back and do it again, using the next index after * the current ’burst’ */ idx = pst[count-1].pst_idx + 1; (void)memset(pst,0,BURST*sizeof(struct pst_status)); } if (count == -1) perror("pstat_getproc()"); #undef BURST } Example 4B Get information about all processes, 10 at a time. We do it this way since the current count of active processes is unknown.
pstat(2) pstat(2) /* got count this time. process them */ for (i = 0; i < count; i++) { (void)printf("pid is %lld, command is %s\n", pst[i].pst_pid, pst[i].pst_ucomm); } /* * now go back and do it again, using the next index after * the current ’burst’ if there are potentially more to find */ if (count) idx = pst[count-1].pst_idx + 1; } while (count); #undef BURST } Example 5 Get information about our parent using pstat_getproc().
pstat(2) pstat(2) perror("pstat_getipc"); } Example 7 List all the open files for the parent process.
pstat(2) pstat(2) } } Example 9 Acquire detailed information about a specific file. main() { struct pst_fileinfo2 psf; struct pst_filedetails psfdetails; int count, fd; (void)memset(&psf,0,sizeof(psf)); (void)memset(&psfdetails,0,sizeof(psfdetails)); 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.
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 %lld\n", psfstream[0].val.head.
pstat(2) pstat(2) } } else { perror("pstat_getfile2"); } close(fd); } Example 12 Acquire path name information about an open file. main() { struct pst_fileinfo2 psf; char filename[20]; int rv, count, fd; (void)memset(&psf,0,sizeof(psf)); (void)memset(filename,0,sizeof(filename)); fd = open("/etc/passwd", O_RDONLY); rv = pstat_getfile2(&psf, sizeof(psf), 0, fd, getpid()); if (rv == 1) { /* * Ask for path name information. */ count = pstat_getpathname(filename, 20, &(psf.
pstat(2) pstat(2) rv = pstat_getfile2(&psf, sizeof(psf), 0, fd, target); if (rv == 1) { /* * Ask for multiple path name 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].
pstat(2) pstat(2) iostat(1), ps(1), top(1), vmstat(1), coreadm(1M), crashconf(1M), fuser(1M), vgdisplay(1M), coreadm(2), crashconf(2), errno(2), mq_open(2), msgctl(2), sem_open(2), semctl(2), shmctl(2), stat(2), sysconf(2), fileno(3S), privileges(5), thread_safety(5).
pstat_getlocality(2) pstat_getlocality(2) NAME pstat_getlocality(), pstat_getproclocality() - returns system-wide or per-process information of a ccNUMA system SYNOPSIS #include
pstat_getlocality(2) pstat_getlocality(2) of localities. The types and field members of the struct pst_locality are as follows: pst_locality_flags_t psl_flags Contains information about the given locality. See the description of pst_locality_flags_t below for details. int64_t psl_ldom_id This is the LDOM id used by mpctl(2) to identify this locality. For the interleaved locality, this field will be -1.
pstat_getlocality(2) pstat_getlocality(2) Notes These functions only return the wide (64 bit) versions of their associated structures. In order for narrow (32 bit) applications to use these interfaces, the flag -D_PSTAT64 must be used at compile time. These interfaces are available for narrow applications written in standard C and extended ANSI, and for all wide applications. RETURN VALUE pstat_getlocality() and pstat_getproclocality() return the following values: n Successful completion.
pstat_getlocality(2) pstat_getlocality(2) main ( int argc, char **argv ) { pid_t pid = (pid_t) 0; if ( (argc == 2) || (argc > 3) || ((argc == 3) && (strncmp(argv[1], "-p", 2))) ) { usage(argc, argv); } if ( argc == 3 ) { pid = atoi(argv[2]); if (pid < 0) { /* note that pid 0 is "this process" */ usage(argc, argv); } } /* Get the size of a page for later calculations */ pgsize = sysconf ( _SC_PAGE_SIZE ); sys_locinfo(); if ( argc == 3 ) { pid_locinfo ( pid ); } return 0; } /* * Display the system-wide memo
pstat_getlocality(2) pstat_getlocality(2) printf ( "%6d%6lld%7lld%6s%10s%10s%10s\n", (idx+i), pstl[i].psl_ldom_id, pstl[i].psl_physical_id, ((pstl[i].
pstat_getlocality(2) pstat_getlocality(2) pid ); printf ( "%6s%10s%10s%10s%10s\n", "idx", "total", "shared", "private", "weighted" ); while ( count == 1 ) { total shared private weighted += += += += ppl.ppl_rss_total; ppl.ppl_rss_shared; ppl.ppl_rss_private; ppl.ppl_rss_weighted; pages_to_str pages_to_str pages_to_str pages_to_str ( ( ( ( ppl.ppl_rss_total, total_str ); ppl.ppl_rss_shared, shared_str ); ppl.ppl_rss_private, private_str ); ppl.
pstat_getlocality(2) if ( gpg > 10 ) sprintf } else if ( mpg sprintf } else if ( kpg sprintf } else { sprintf } pstat_getlocality(2) { ( > ( > ( str, "%lluG", gpg ); 10 ) { str, "%lluM", mpg ); 1 ) { str, "%lluK", kpg ); ( str, "%llu", pages ); } AUTHOR The pstat routines were developed by Hewlett-Packard Company. SEE ALSO pstat(2), mpctl(2).
putmsg(2) putmsg(2) NAME putmsg, putpmsg - send a message on a stream SYNOPSIS #include int putmsg( int fildes, const struct strbuf const struct strbuf int flags ); int putpmsg( int fildes, const struct strbuf const struct strbuf int band, int flags ); *ctlptr, *dataptr, *ctlptr, *dataptr, 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 putmsg() and putpmsg() return the following values: 0 Successful completion. -1 Error. errno is set to indicate the error. ERRORS On failure, errno may be set to one of the following values: [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.
quotactl(2) quotactl(2) NAME quotactl - manipulate disk quotas SYNOPSIS #include int quotactl(int cmd, const char *special, id_t id, void *addr); DESCRIPTION quotactl() manipulates disk quotas. cmd indicates a command to be applied to the user or group ID id. A command is composed of a primary command and a type that is used to interpret the id parameter. Types supported are USRQUOTA for users and GRPQUOTA for groups. To set the type of quota use the QCMD(cmd, type) macro.
quotactl(2) [EBUSY] quotactl(2) Q_QUOTAON attempted while another Q_QUOTAON or Q_QUOTAOFF is in progress. [EDQUOT] User’s disk quota block limit has been reached for this file system. [EFAULT] The addr or special parameter points to an invalid address. Reliable detection of this error is implementation-dependent. [EINVAL] The parameters cmd and/or id are invalid. [ENODEV] The parameter special contains a type of file system that does not support quotas.
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) 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) Upon successful completion, readv() marks for update the st_atime field of the file. The pread() function performs the same action as read() , except that it reads from a given position in the file without changing the file pointer. The first three arguments of pread() are the same as read() with the addition of a fourth argument offset for the desired position inside the file. An attempt to perform a pread() on a file that is incapable of seeking results in an error.
read(2) read(2) The readv() function may fail if: [EINVAL] The iovcnt argument was less than or equal to 0, or greater than {IOV_MAX} . The pread() function will fail and the file pointer remains unchanged if: [EINVAL] The offset argument is invalid. The value is negative. [EOVERFLOW] The file is a regular file and an attempt was made to read at or beyond the offset maximum associated with the file. [ESPIPE] fildes is associated with a pipe or FIFO.
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) STANDARDS CONFORMANCE readlink() : AES, SVID3 r HP-UX 11i Version 3: February 2007 −2− Hewlett-Packard Company 333
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 X/Open Sockets Only below). This structure is defined in
recv(2) recv(2) • If 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) [ENOSR] Buffers could not be allocated for the message that was to be created due to insufficient STREAMS memory resources. [ENOTCONN] Receive on a SOCK_STREAM socket that is not yet connected. [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.
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). 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) RETURN VALUE rtprio() returns the following values: 0 to 127 The process was a real-time process. The value is the process’s former (before the call) real-time priority. RTPRIO_RTOFF -1 The process was not a real-time process. An error occurred. errno is set to indicate the error. ERRORS If rtprio() fails, errno is set to one of the following values: [EACCES] The target process could not be accessed due to compartmental restrictions.
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) PRI_POSIX_TO_HPUX() rtsched(2) Convert POSIX priority to HP-UX sched_setparam() The sched_setparam() function sets the scheduling parameters of the process specified by pid to the values specified by the sched_param structure pointed to by param. The value of the sched_priority member in the param structure is any integer within the inclusive priority range for the current scheduling policy of the process specified by pid.
rtsched(2) rtsched(2) param, respectively. The value of the sched_priority member in the param structure can be any integer within the inclusive priority range for the scheduling policy specified by policy. The possible values for the policy parameter are defined in the header file , and mentioned below. If a process described by pid exists, the scheduling policy and scheduling parameters are set for the process whose process ID is equal to pid.
rtsched(2) rtsched(2) PRI_HPUX_TO_POSIX(), PRI_POSIX_TO_HPUX() These two functions serve to map (translate) the range of HP-UX priorities into the POSIX.4 model. These translations are necessary because the POSIX.4 standard chose larger numbers to represent stronger priorities and the existing HP-UX behavior, which must be maintained for backward compatibility, uses smaller numbers for stronger priorities. The PRI_HPUX_TO_POSIX() function returns the POSIX.
rtsched(2) rtsched(2) contains at least 32 priorities. SCHED_RR Round-robin scheduling policy, with a per-system time slice (time quantum).
rtsched(2) rtsched(2) priority in the priority range for SCHED_OTHER is weaker than the weakest priority in the priority ranges for any of the other policies, SCHED_FIFO , SCHED_RR , and SCHED_RR2 . SCHED_NOAGE A timeshare scheduling policy with nondecaying priorities. For processes executing under this policy, the implementation can use only priorities within the range returned by the functions sched_get_priority_max() and sched_get_priority_min() when SCHED_NOAGE is provided as the parameter.
rtsched(2) rtsched(2) ERRORS If the functions fail, errno is set to one of the following values. sched_setparam() [EACCES] The target process could not be accessed due to compartmental restrictions. [EFAULT] The param argument points to an invalid address. [EINVAL] One or more of the requested scheduling parameters is outside the range defined for the scheduling policy of the specified pid. [ENOSYS] The function is not supported by this implementation.
rtsched(2) rtsched(2) maxpri = sched_get_priority_max(SCHED_FIFO); if (maxpri == -1) { perror("sched_get_priority_max() failed"); exit(1); } param.sched_priority = maxpri; if (sched_setscheduler(getpid(), SCHED_FIFO, ¶m) == -1) { perror("sched_setscheduler() failed"); exit(1); } AUTHOR The sched_*() functions were derived from the proposed IEEE POSIX P1003.4 standard, draft 14. PRI_HPUX_TO_POSIX() and PRI_POSIX_TO_HPUX() were developed by HP. SEE ALSO rtsched(1), rtprio(2), privileges(5).
select(2) select(2) NAME select(), pselect(), FD_CLR(), FD_ISSET(), FD_SET(), FD_ZERO() - synchronous I/O multiplexing SYNOPSIS #include
select(2) select(2) Implementations may place limitations on the maximum timeout interval supported. On all implementations, the maximum timeout interval supported will be at least 31 days. If the timeout argument specifies a timeout interval greater than the implementation-dependent maximum value, the maximum value will be used as the actual timeout value. Implementations may also place limitations on the granularity of timeout intervals.
select(2) select(2) The FD_SETSIZE is used in the definition of fd_set structure. It is set to a value of 2048 to accommodate 2048 file descriptors. Any user code that uses FD_SETSIZE or the structure fd_set should redefine FD_SETSIZE to a smaller value (greater than or equal to the number of open files the process will have) in order to save space and execution time. Similarly, any user code that wants to test more than 2048 file descriptors should redefine FD_SETSIZE to the required higher value.
select(2) select(2) reading from the terminals is not shown in this example. Also, note that this example must be modified if the calling process has more than 32 file descriptors open. Following this first example is an example of select with more than 32 file descriptors.
select(2) select(2) ttymask[i] = MASK(tty[i]); readmask.fds_bits[k] |= ttymask[i]; } timeout.tv_sec = 5; timeout.tv_usec = 0; for (k=0; k < NWORDS; k++) readfds.fds_bits[k] = readmask.
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), privileges(5), .
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 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. The fourth argument is optional and depends on the operation requested. If present, it must be of type union semun , which the application program must explicitly declare.
semctl(2) semctl(2) sem_perm.cuid in the data structure associated with semid. IPC_RMID Remove the semaphore identifier specified by semid from the system and destroy the set of semaphores and data structure associated with it. This cmd can only be executed by a process that has an effective user ID equal to either that of a user with the OWNER privilege or to the value of either sem_perm.uid or sem_perm.cuid in the data structure associated with semid.
semctl(2) semctl(2) SEE ALSO ipcrm(1), ipcs(1), semget(2), semop(2), privileges(5), glossary(9).
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) [EACCES] A semaphore identifier exists for key, but operation permission as specified by the low-order 9 bits of semflg would not be granted. [EINVAL] A semaphore identifier exists for key, but the number of semaphores in the set associated with it is less than nsems, and nsems is not equal to zero. [ENOENT] A semaphore identifier does not exist for key and (semflg & IPC_CREAT ) is "false".
semop(2) semop(2) NAME semop(), semtimedop() - semaphore operations SYNOPSIS #include #include int semop( int semid, struct sembuf *sops, size_t nsops ); int semtimedop( int semid, struct sembuf *sops, size_t nsops, const struct timespec *timeout ); 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.
semop(2) semop(2) If semaphore value is zero, semop() proceeds to the next semaphore operation specified by sops , or returns immediately if this is the last operation. If semaphore value is not equal to zero and (sem_flg & IPC_NOWAIT ) is "true", semop() returns immediately.
semop(2) [ENOSPC] [EINVAL] semop(2) The limit on the number of individual processes requesting an SEM_UNDO would be exceeded. The number of individual semaphores for which the calling process requests a SEM_UNDO would exceed the limit. [ERANGE] An operation would cause a semaphore value to overflow the system-imposed limit. [ERANGE] An operation would cause a semadj value to overflow the system-imposed limit. [EFAULT] sops points to an illegal address.
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 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. • If there is not enough space in the buffer to write out the entire request, send() completes successfully, having written as much data as possible, and returns the number of bytes it was able to write.
send(2) send(2) 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 buffer len */ flags on received message */ msg_control specifies a buffer of ancillary data to send along with the message.
send(2) send(2) 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. This is also given if the specified address contains unspecified fields (see inet(7F)).
send(2) send(2) 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. These pieces, called IP fragments, can be transmitted, but IP does not guarantee delivery.
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) 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. [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) 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. Since ordinary users cannot create groups, their ability to control file access with ACLs might be somewhat limited. Security Restrictions The effective user ID of the process must match the owner of the file, or it must be the superuser or a user with the OWNER privilege to set a file’s ACL.
setacl(2) setacl(2) [ENOSYS] The function is not supported by this file system type. [ENOSPC] Not enough space on the file system. [ENFILE] System file table is full. [EDQUOT] User’s disk quota block or inode limit has been reached for this file system. EXAMPLES The following code fragment defines and sets an ACL on file ../shared which allows the file’s owner to read, write, and execute or search the file, and allows user 103, group 204 to read the file. #include #include
setaudid(2) setaudid(2) (TO BE OBSOLETED) NAME setaudid() - set the audit ID (aid) for the current process SYNOPSIS #include int setaudid(aid_t audid); Remarks This function is provided purely for backward compatibility. HP recommends that new applications use setauduser() instead. See setauduser(3). DESCRIPTION setaudid() sets the audit ID (aid) in the audit tag for the current process. This call is restricted to a user with the SELFAUDIT privilege.
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.
seteuid(2) seteuid(2) NAME seteuid(), setegid() - set effective user and group IDs SYNOPSIS #include int seteuid(uid_t euid); int setegid(gid_t egid); DESCRIPTION seteuid() sets the effective user ID of the calling process, if euid is equal to the current real or saved user ID, or if the process has appropriate privileges. The real user ID and saved set-user-ID remain unchanged.
setevent(2) setevent(2) (TO BE OBSOLETED) 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[] ); Remarks This function is provided purely for backward compatibility. HP recommends that new applications use the audevent command to get events and system calls that are currently being audited. See audevent(1M).
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 sysconf(_SC_NGROUPS_MAX).
sethostname(2) sethostname(2) NAME sethostname() - set name of current host system SYNOPSIS #include int sethostname(const char *name, size_t namelen); DESCRIPTION The sethostname() system call sets the name of the current system 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.
setregid(2) setregid(2) NAME setregid - sets the real and effective group IDs SYNOPSIS #include int setregid(gid_t rgid , gid_t egid ); DESCRIPTION setregid() sets the real and effective group IDs of the calling process. Only a privileged process can set the real group ID and/or the effective group ID to any valid value.
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.
settimeofday(2) settimeofday(2) NAME settimeofday - set the date and time SYNOPSIS #include int settimeofday struct timeval *tp, const struct timezone *tzp); DESCRIPTION The settimeofday() function sets the current time, expressed as seconds and microseconds since Epoch, and passed as the timeval structure pointed to by tp. The resolution of the system clock is one microsecond. Security Restrictions Setting the time of day requires the PRIV_SYSATTR privilege (SYSATTR).
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 takes effect immediately, except in the cases noted below. Some parameters cannot be changed without rebooting the kernel. These parameters cannot be changed using settune() .
settune(2) settune(2) WARNINGS It is possible to seriously degrade system performance, or even render a system unbootable, with incorrect tunable settings. Use care when setting tunable values. Always have a known working kernel configuration saved as a backup; if the system fails to boot after a tunable change, boot from that backup kernel configuration. Keep good records of all tunable changes so that they can be reversed if they degrade system performance.
settune_txn(2) settune_txn(2) NAME settune_txn() - sets the values of kernel tunable parameters in a transaction SYNOPSIS #include int settune_txn (uint64_t version, struct ktune_context *transaction, size_t struct_size, uint64_t num_elements, char *err_buf, uint64_t *err_bufsize, uint64_t stf_flags); PARAMETERS version transaction The version parameter should always be set to SETTUNE_VERSION. The details of the changes are specified in an array of ktune_context structures.
settune_txn(2) settune_txn(2) • None of the changes within a transaction succeed or all of the changes within a transaction succeed. There are no in-betweens. • No duplicates are allowed within a transaction, where duplicates are defined as more than one change to a tunable. • There are no restrictions on the order in which the tunables need to be specified within a transaction. Some parameters represent limits on resources that can be consumed by individual processes.
settune_txn(2) settune_txn(2) configuration saved as a backup; if the system fails to boot after a tunable change, boot from that backup kernel configuration. Keep good records of all tunable changes so that they can be reversed if they degrade system performance. Tunable changes made with settune_txn() are automatically logged to syslog .
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. If the Security Containment product is installed, these interfaces treat a process observing CHSUBJIDENT as a privileged process. Otherwise, only processes with an euid of zero are treated as privileged processes.
setuid(2) setuid(2) setgid() was developed by AT&T. SEE ALSO exec(2), getuid(2), setresuid(2), privileges(5). STANDARDS CONFORMANCE setuid() : AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1 setgid() : AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.
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) shm_open(2) [EINVAL] The shm_open() operation is not supported for the given name. [EMFILE] 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.
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] shmid is not a valid shared memory identifier. [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. [EOVERFLOW] cmd is equal to IPC_STAT . The attached process count of a shared memory object is too large for the field in the data structure provided by the application. Recompile the application with the latest /usr/include/sys/ipc.
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) System V Shared Memory Under Adaptive Address Space Itanium-based platforms have the capability to create two types of processes: MGAS (Mostly Global Address Space), which is the default, and MPAS (Mostly Private Address Space). See ld(1) and chatr(1). If 64-bit MPAS and 64-bit MGAS processes want to share a mapping among themselves without incurring the cost of aliasing, then (shmflg & IPC_GLOBAL ) should be "true", but (shmflg & IPC_SHARE32 ) should be "false".
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) [EACCES] Operation permission is denied to the calling process. [EINVAL] shmid is not a valid shared memory identifier, (possibly because the shared memory segment was already removed using shmctl(2) with IPC_RMID ), or the calling process is already attached to shmid. [EINVAL] shmaddr is not zero and the machine does not permit nonzero values, or shmaddr is not equal to the current attach location for the shared memory segment.
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] [ENOTCONN] [EINVAL] shutdown(2) HP-UX BSD Sockets only. The specified socket is not connected. X/Open Sockets only. The specified socket is not connected. X/Open Sockets only. The how argument is invalid. WARNINGS Linking binary objects compiled to X/Open Sockets specification and binary objects compiled to HP-UX BSD Sockets specification to the same executable may result in unexpected behavior, including application abnormal termination and unexpected socket errors.
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 is interrupted by this signal, the function will restart and will not fail with [EINTR] unless otherwise specified. If the flag is not set, 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.
sigaction(2) sigaction(2) sigprocmask() or sigsuspend() is made). This mask is formed by taking the union of the current signal mask and the value of the sa_mask for the signal being delivered unless SA_NODEFER or 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.
sigaction(2) sigaction(2) The selection order between realtime and nonrealtime signals, or between multiple pending nonrealtime signals, is unspecified. Signals generated by kill() or other events that cause signals to occur, such as detection of hardware faults, alarm() timer expiration, or terminal activity, and for which the implementation does not support queueing, will have no effect on signals already queued for the same signal number.
sigaction(2) sigaction(2) void func(int signo, siginfo_t *siginfo, void *ucontextptr); where func is the specified signal-catching function, signo is the signal number of the signal being delivered, siginfo points to an object of type siginfo_t associated with the signal being delivered, and ucontextptr points to a ucontext_t .
sigaction(2) sigaction(2) Note that longjmp() and siglongjmp() are not in the list of reentrant functions. This is because the code executing after longjmp() and siglongjmp() can call any unsafe functions with the same danger as calling those unsafe functions directly from the signal handler. Applications that use longjmp() and siglongjmp() from within signal handlers require rigorous protection in order to be portable.
sigaction(2) sigaction(2) WARNINGS The fpathconf() function is marked as an extension in the list of safe functions because it is not included in the corresponding list in the ISO POSIX-1 standard, but it is expected to be added in a future revision of that standard. 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) if (sigaltstack(&sigstk,(stack_t *)0) < 0) perror("sigaltstack"); In some implementations, a signal (whether or not indicated to execute on the alternate stack) will always execute on the alternate stack if it is delivered while another signal is being caught using the alternate stack. On some implementations, stack space is automatically extended as needed. On those implementations, automatic extension is typically not available for an alternate stack.
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
signal(2) signal(2) Acceptable values for sig are described in signal (5). Acceptable values for func are: SIG_DFL Execute the default action, which varies depending on the signal. The default action for most signals is to terminate the process (see signal(5)). A pending signal is discarded (whether or not it is blocked) if action is set to SIG_DFL but the default action of the pending signal is to ignore the signal (as in the case of SIGCLD ). SIG_IGN Ignore the signal.
signal(2) signal(2) If disp is not SIG_DFL , SIG_IGN , or SIG_HOLD , it must be a pointer to a function, the signal-catching handler, that is called when signal sig occurs. Before calling the signal-catching handler, the system signal action of sig is set to SIG_HOLD . Any pending signal of this type is released. This handler address is retained across calls to the other signal management functions listed here.
signal(2) signal(2) the variables. If they have not changed, call sigpause() to wait for the signal. Threads Considerations The signal disposition (such as catch/ignore/default) established by signal() is shared by all threads in the process. Blocked signal masks are maintained by each thread.
sigpending(2) sigpending(2) NAME sigpending - examine pending signals SYNOPSIS #include int sigpending(sigset_t *set); DESCRIPTION sigpending() stores the set of signals that are blocked from delivery and are pending to the calling thread, 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.
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 thread 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) SEE ALSO pthread_sigmask(3T), sigaction(2), sigpending(2), sigsetops(3C), sigsuspend(2), signal(5). CHANGE HISTORY First released in Issue 3. Entry included for alignment with the POSIX.1-1988 standard. 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.
sigqueue(2) sigqueue(2) [EINVAL] The value of the signo argument is an invalid or unsupported signal number. [EPERM] The process does not have the appropriate privilege to send the signal to the receiving process. [ESRCH] The process pid does not exist. SEE ALSO kill(2), sysconf(2), privileges(5), signal(5).
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.
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), malloc(3C), setjmp(3C).
sigsuspend(2) sigsuspend(2) NAME sigsuspend - wait for a signal SYNOPSIS #include int sigsuspend(const sigset_t *sigmask); DESCRIPTION The sigsuspend() function replaces the current signal mask of the calling thread with the set of signals pointed to by sigmask and then suspends the thread until delivery of a signal whose action is either to execute a signal-catching function or to terminate the process.
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) cases, Internet protocol (IP) and the X.25-to-IP interface module are used. 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.
socket(2) socket(2) SEE ALSO accept(2), bind(2), connect(2), getsockname(2), getsockopt(2), ioctl(2), listen(2), recv(2), select(2), send(2), shutdown(2), privileges(5), thread_safety(5), route(7P), socket(7), TCP(7P), UDP(7P), UNIX(7P), xopen_networking(7).
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.
sprofil(2) sprofil(2) NAME sprofil() - execution time profile for disjointed text spaces SYNOPSIS #include #include int sprofil( struct prof *profp, int profcnt, struct timeval *tvp, unsigned int flags ); DESCRIPTION sprofil() 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.
sprofil(2) sprofil(2) by the pr_base field is incremented, unless that would result in overflow. Each call to sprofil() disables profiling if it was enabled and then enables profiling of the regions specified by the prof array entries. Due to variations in instruction length on different architectures, the pr_scale setting results in different entry-to-instruction ratios.
sprofil(2) sprofil(2) Notes Profiling is turned off when an exec() is executed, but remains on in both child and parent processes after a fork() . A call to profil() has the same effect as calling sprofil() with just one member in the profp array with the fields profcnt, tvp, and flags taking on the values of 1, NULL , and PROF_USHORT respectively. RETURN VALUE On success, sprofil() returns 0. Otherwise, it returns -1 and sets the global variable errno to indicate the error.
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 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) RETURN VALUE Upon successful completion, 0 is returned. Otherwise, −1 is returned and errno is set to indicate the error. ERRORS The stat() function will fail if: [EACCES] Search permission is denied for a component of the path prefix. [EFAULT] buf or path points to an invalid address. The reliable detection of this error is implementation dependent. [EIO] An error occurred while reading from the file system. [ELOOP] Too many symbolic links were encountered in resolving path.
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) [ENOTDIR] A component of the path prefix is not a directory. [EOVERFLOW] Result would overflow one or more fields of the statfs struct. If fstatfs() fails, errno is set to one of the following values: [EBADF] fildes is not a valid open file descriptor. [EFAULT] buf points to an invalid address. [EIO] An I/O error occurs while reading from or writing to the file system. WARNINGS statfs() is deprecated and should be used only by legacy 32-bit applications.
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) ST_GRPQUOTA statvfs(2) Group quotas enabled on this file system. Security Restrictions The field f_bavail is the number of blocks available to non-superusers or users without the LIMIT privilege. The field f_favail is the number of file nodes available to non-superusers or users without the LIMIT privilege. See privileges(5) for more information about privileged access on systems that support fine-grained privileges.
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). Security Restrictions Some or all of the actions associated with this system call require the SYSATTR privilege. Processes owned by the superuser will have this privilege.
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).
swapctl(2) swapctl(2) NAME swapctl - manage and configure system swap space SYNOPSIS #include int swapctl(int cmd, void * arg); PARAMETERS cmd Specifies the operation to be performed, which includes: adding a resource, deleting a resource reservation, and listing the swap resources. arg SC_ADD SC_LIST Add a new swap resource to the system. SC_REMOVE Remove the swap device configured on the system. Currently only the primary swap for the next boot will be removed.
swapctl(2) swapctl(2) sr_lim (Needed for file system swap only.) Indicates the maximum number of file system blocks the swap system is allowed to take from the file system. sr_res (Needed for file system swap only.) Indicates the number of file system blocks that are saved for file system use only. For the SC_ADD command, depending on the sr_flag type, the following members of swapres structure need to be passed in.
swapctl(2) swapctl(2) The SC_LIST Command For the SC_LIST command, arg parameter is a pointer to the swaptable structure with following members: int swt_n swapctl_flags_t swt_flag struct swapent swt_ent [] where: swt_n Specifies the maximum entries that will be returned by swapctl() . swt_ent Is an array of swt_n swapents . Currently the SC_LIST command can be used to list the primary swap configured for next boot, so the array size for the swapent structures is 1.
swapctl(2) swapctl(2) [EIO] Unable to read or write to the kernel registry services (see krs(5)). [EFAULT] Specifies that the structure pointed to by the arg parameter or swt_ent field of swaptable_t struct, or one of the fields sr_name or ste_path is outside the allocated address space. [EINVAL] Invalid input parameter passed in.
swapctl(2) swapctl(2) exit(1); } /* list the swap device configured above */ swent.ste_path = path; swt.swt_n = 1; swt.swt_flags = SW_PRIMARY | SW_NEXTBOOT; swt.swt_ent = &swent; rv = swapctl(SC_LIST, (void *)&swt); if (rv != 1) { /* returns the number of swap devices returned */ printf("swapctl/SC_LIST returned: %d \n", rv); perror("swapctl/SC_LIST failed"); exit(2); } printf("Primary swap for next boot: %s \n", swent.ste_path); /* Remove the above configured primary swap */ swp.
swapon(2) swapon(2) (TO BE OBSOLETED) NAME swapon() - add swap space for interleaved paging and 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 (/* */ ).
swapon(2) swapon(2) (TO BE OBSOLETED) [EINVAL] One of priority, min, limit, or reserve arguments is invalid. [EALREADY] The device associated with path already has swap turned on. [EBUSY] The device associated with path is already in use. [EEXIST] The device associated with path was specified at system configuration time to add swap at a specified location, but that location is within an existing file system on the device.
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) STANDARDS CONFORMANCE symlink() : AES, SVID3 CHANGE HISTORY First released in Issue 4, Version 2.
sync(2) sync(2) NAME sync, lsync - update disk SYNOPSIS #include void sync(void); void lsync(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 , and so on. 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) Maximum length of strings allowed by bc (see bc(1)). CCNUMA_SUPPORT (_SC_CCNUMA_SUPPORT) Positive if the implementation supports multiple locality domains; -1 otherwise (see mpctl(2)). CHILD_MAX (_SC_CHILD_MAX) Maximum number of simultaneous processes per user ID (see fork(2)). CLK_TCK (_SC_CLK_TCK ) Number of clock intervals per second for times() (see times(2)). CLOCKS_PER_SEC (_SC_CLOCKS_PER_SEC) Number of clock ticks per second for clock() (see clock(3C)).
sysconf(2) sysconf(2) Maximum parenthesis nesting level for expr expressions (see expr(1)). GETGR_R_SIZE_MAX (_SC_GETGR_R_SIZE_MAX) GETPW_R_SIZE_MAX (_SC_GETPW_R_SIZE_MAX) Maximum getgrgid_r() , getgrnam_r() data buffer size. Maximum getpwuid_r() , getpwnam_r() data buffer size. HOST_NAME_MAX (_SC_HOST_NAME_MAX) Maximum length of a host name (not including the terminating null) (see gethostname(2)). HT_CAPABLE (_SC_HT_CAPABLE) 1 if the hardware is capable of HyperThreading.
sysconf(2) sysconf(2) q One of the following values: 0 1 2 3 4−9 N LINE_MAX 32PA 64PA 32EM 64EM Reserved One of the following values: 0 Archive library 1−9 System V version of shared library (_SC_LINE_MAX ) Maximum number of bytes in an input line (including the newline) for POSIX.2 utilities. LOGIN_NAME_MAX (_SC_LOGIN_NAME_MAX) Maximum length of user name in bytes. MAPPED_FILES (_SC_MAPPED_FILES) Not supported.
sysconf(2) sysconf(2) Positive if the system supports POSIX Asynchronous Input and Output. POSIX_BARRIERS (_SC_BARRIERS ) Equal to 200112 if the Barriers option is supported; -1 otherwise. POSIX_CLOCK_SELECTION (_SC_CLOCK_SELECTION) Equal to 200112 if the Clock Selection option is supported; -1 otherwise. POSIX_CPUTIME (_SC_CPUTIME ) Equal to 200112 if the Process CPU-Time Clocks option is supported; -1 otherwise.
sysconf(2) sysconf(2) Positive if the system supports POSIX.4 real time signal extensions; -1 otherwise. POSIX_REGEXP (_SC_REGEXP ) Equal to 200112 if the Regular Expression Handling option is supported; -1 otherwise. POSIX_SAVED_IDS (_SC_SAVED_IDS) Positive if each process has a saved set-user-ID and a saved set-group-ID; -1 otherwise. POSIX_SEMAPHORES (_SC_SEMAPHORES) Positive if the system supports POSIX semaphores.
sysconf(2) sysconf(2) POSIX_THREAD_PRIO_PROTECT (_SC_THREAD_PRIO_PROTECT) Positive if the implementation supports the POSIX Thread Priority Protection option; -1 otherwise. POSIX_THREAD_PROCESS_SHARED (_SC_THREAD_PROCESS_SHARED) Positive if the implementation supports the POSIX Thread Process-Shared Synchronization option; -1 otherwise. POSIX_THREAD_SAFE_FUNCTIONS (_SC_THREAD_SAFE_FUNCTIONS) Positive if the implementation supports the POSIX Thread Thread-Safe Functions option; -1 otherwise.
sysconf(2) sysconf(2) Maximum length of a terminal device name. POSIX_TYPED_MEMORY_OBJECTS (_SC_TYPED_MEMORY_OBJECTS) Equal to 200112 if the Typed Memory Objects option is supported; -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) POSIX2_SW_DEV sysconf(2) (_SC_2_SW_DEV ) Equal to 1 if the POSIX.2 Software Development Utilities Option is supported; -1 otherwise. POSIX2_UPE (_SC_2_UPE ) Equal to 1 if the POSIX.2 User Portability Utilities Option is supported; -1 otherwise. POSIX2_VERSION (_SC_2_VERSION) Current version of POSIX.2 (same format as _POSIX_VERSION). PRIORITIZED_IO (_SC_PRIORITIZED_IO) Not supported.
sysconf(2) STREAM_MAX sysconf(2) (_SC_STREAM_MAX) Maximum number of stdio streams that one process can have open at one time. TIMER_MAX (_SC_TIMER_MAX) Maximum number of POSIX.4 timers per process, if POSIX.4 timers are supported; -1 otherwise. TTY_NAME_MAX (_SC_TTY_NAME_MAX) Value of TTY_NAME_MAX . TZNAME_MAX (_SC_TZNAME_MAX) Maximum number of bytes in a time zone name for the TZ environment variable.
sysconf(2) sysconf(2) A return value of -1 indicates they are not supported. XBS5_LPBIG_OFFBIG (_SC_XBS5_LPBIG_OFFBIG) A flag that denotes whether _CS_XBS5_LPBIG_OFFBIG_CFLAGS, _CS_XBS5_LPBIG_OFFBIG_LDFLAGS, _CS_XBS5_LPBIG_OFFBIG_LIBS and _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS are supported by confstr() . A return value of -1 indicates they are not supported.
sysconf(2) sysconf(2) SEE ALSO bc(1), expr(1), getconf(1), prmconfig(1), localedef(1M), errno(2), exec(2), fork(2), fsync(2), gethostname(2), getrlimit(2), lio_listio(2), mlockall(2), mpctl(2), munlockall(2), open(2), pathconf(2), times(2), atexit(3), clock(3C), confstr(3C), regcomp(3C), aio(5), limits(5), stdsyms(5), thread_safety(5), unistd(5). HP Process Resource Manager: prmconfig(1) in HP Process Resource Manager User’s Guide.
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 timers: timer_create(), timer_delete(), timer_getoverrun(), timer_gettime(), timer_settime() - 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) [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_create(CLOCK_REALTIME, &sigev, &timerid) == -1) { perror("timer_create"); exit(1); } if (timer_settime(timerid, 0, &one_minute, (struct itimerspec *)NULL) == -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.
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) [ENOENT] A component of path does not name an existing file or path is an empty string. [ENOTDIR] A component of the path prefix of path is not a directory. [EROFS] The named file resides on a read-only file system. [ETXTBSY] The file is a pure procedure (shared text) file that is being executed. AUTHOR truncate() was developed by the University of California, Berkeley.
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 addr2 argument specifies the action to be taken by the loader when the target process does an exec() . If the value is TT_GEN_SHLIB_BPT, the loader will communicate certain events to the debugger through an architected break instruction. The information obtained through these events can be used by the debugger to identify all the load modules in the program and their unwind information. If the debugger is not interested in these events the value must be set to 0 (zero).
ttrace(2) ttrace(2) TT_PROC_GET_EVENT_MASK This request returns the process-wide event flags and signal mask values. The data argument specifies the number of bytes to be read from the context of the traced process into the ttevent_t data structure in user space pointed to by addr. The lwpid and addr2 arguments must be set to zero.
ttrace(2) ttrace(2) The lwpid and addr2 arguments must be set to zero. The resulting signal mask on the traced process will be a union of the current signal mask on the target process and the set pointed by the ttm_signals field in the ttmask_t structure. Setting the ttm_signals to an empty set results in clearing the signal mask that was previously set using this request. TT_PROC_GET_FIRST_LWP_STATE This request returns the ttstate_t structure associated with the first thread on the stopped list.
ttrace(2) ttrace(2) 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) tts_siginfo is the siginfo , if applicable. The data associated with a TTEVT_LWP_CREATE, TTEVT_LWP_TERMINATE or TTEVT_LWP_ABORT_SYSCALL event is as follows: typedef struct { lwpid_t tts_target_lwpid; } ttthread_data_t; tts_target_lwpid is the lwpid of the targeted lwp. The data associated with a TTEVT_SYSCALL event is as follows: typedef struct { int64_t tts_rval[2]; int tts_errno; } ttsyscall_data_t; The tts_rval fields are the return value(s) of the system call.
ttrace(2) ttrace(2) new protection. Note that protection changes affect whole pages (see mprotect (2) for more information). For this request, the lwpid argument must be set to zero. TT_PROC_SET_SCBM This request allows the debugger to pass a bitmap to the kernel indicating which system calls should cause a debugger stop.
ttrace(2) ttrace(2) Note: These requests are not supported on PA-RISC versions of HP-UX. TT_PROC_GET_ARGS, TT_PROC_GET_ARGS_NOATTACH These requests return a pointer to the argument list passed to the initial thread of the process at execve() time (that is, argc, argv, envp). If the target process has not overwritten these arguments, this address can be used to retrieve the full argument and environment list. Note: These requests are not supported on PA-RISC versions of HP-UX.
ttrace(2) ttrace(2) from addr2 will be written to the instruction or data breakpoint register(s) named by addr. For Itanium-based systems, addr must be an even number less than the value returned by TT_PROC_GET_NUM_IBPT_REGS or TT_PROC_GET_NUM_DBPT_REGS respectively. data must be 16 bytes. The request will set a value into the pair of instruction or data breakpoint registers addr and addr+1. These values will be enabled only when the specified thread is running.
ttrace(2) ttrace(2) __tp __r13 R/W R/W __r14-__r31 R/W Reads as 0 See TT_LWP_RDRSEBS and TT_LWP_WRRSEBS __r32-__r127 __f2-__f5 R/W R/W __f6-__f15 R/W Read as 0.0 __f16-__f31 R/W R/W __f32-__f127 R/W Read as 0.0 Writes may return [EINVAL] if the Hi FP registers were not live when the target thread stopped. __pr R/W R/W Writes to p6-p15 in a syscall context may be ignored.
ttrace(2) ttrace(2) __ar_pfs __ar64 R/W R __ar_lc __ar65 R/W R/W __ar_ec __ar66 R/W R/W __reason R R 0 == syscall context, non-zero == interruption context __ip R/W R/W Low-order 2-bits indicate slot number. __cfm R/W R/W Current Frame Marker corresponding to __ip __ed R/W Reads as 0 May not be set if not previously set. __cr_isr __cr17 R __cr_iipa __cr22 R On PA-RISC systems, the words at offset addr in the save_state structure are returned to the calling process.
ttrace(2) ttrace(2) Name Type Description ttv_req ttreq_t Request (Limited TT_LWP_STOP, TT_LWP_CONTINUE, TT_LWP_RUREGS, TT_LWP_WUREGS) ttv_lwpid lwpid_t Light-Weight Process (thread) ID specifying a valid thread within the target process on which to perform request ttv_req ttv_addr uint64_t addr argument to request ttv_req ttv_data uint64_t data argument to request ttv_req ttv_addr2 uint64_t addr2 argument to request ttv_req to: The array of tt_vec_t s must be cleared (for example, with
ttrace(2) ttrace(2) The addr argument points to a location in the calling process’s address space containing an array of up to TT_VEC_MAX tt_reg_vec s, each containing the arguments for the request(s) to be performed. The tt_reg_vec_t structure contains the following fields: Name Type Description ttrv_reg uint64_t Register to read ttrv_size uint64_t Size to read ttrv_addr Points to the location in the calling process’s address space where the data will be written.
ttrace(2) ttrace(2) thread, only the specific thread will respond to the event. Important If an event is requested by the process, the event mask of the thread is not examined. For the event mask of the thread to be significant, the process event must be be unset. Similarly, if an event option is enabled in the process, the option for the thread is not considered. Event masks may be inherited across fork() using the tte_opts options in the ttevent_t structure.
ttrace(2) ttrace(2) TTEVT_SYSCALL_RETURN This event flag indicates that the traced process will notify the debugger upon return of all system calls. The traced process will also provide the following information: the system call number, its number of arguments and all its arguments, its return value and its error return in the ttstate_t structure.
ttrace(2) ttrace(2) [EACCES] The process is already being traced. [EAGAIN] Unable to attach to a process. This error can only be encountered when attaching to a process in the middle of an exec() syscall. [EDEADLK] One thread of a multithreaded process (p1) has performed a vfork() , the child (p2) is stopped at the vfork event and the debugger is attempting to stop or resume a thread in the parent process (p1). [EFAULT] Invalid user address.
ttrace(2) ttrace(2) [ESRCH] pid and/or lwpid identify a process or a thread to be traced that does not exist or has not executed a ttrace() with the TT_PROC_SETTRC request. EXAMPLES A simple no-frills system call tracer: #include #include #include #include #include #include pid_t
ttrace(2) ttrace(2) static void errexit(const char *p) { (void) fprintf(stderr, "%s: %s\n", p, strerror(errno)); if (ppid) { (void) kill(ppid, SIGINT); } exit (1); } static void dottrace(ttreq_t req, pid_t pid, lwpid_t lwpid, uint64_t addr2) { int rval; char *p; static _exp_t tab[] = { TT_PROC_SETTRC, TT_PROC_ATTACH, TT_PROC_DETACH, TT_PROC_CONTINUE, TT_PROC_SET_EVENT_MASK, TT_PROC_GET_FIRST_LWP_STATE, TT_PROC_GET_NEXT_LWP_STATE, TT_LWP_CONTINUE, -1, }; uint64_t addr, uint64_t data, "PROC_SETTRC", "PROC
ttrace(2) ttrace(2) SYS_sigtimedwait, -1, "sigtimedwait", NULL, }; if (stp->tts_scno == SYS_siginhibit || stp->tts_scno == SYS_sigenable) { return; } if (evt == TTEVT_NONE) { evt = TTEVT_SYSCALL; } p = gen_name(tab, stp->tts_scno); if (p == NULL) { char buf[32]; (void) sprintf(buf, "syscall_%#x", stp->tts_scno); p = buf; } (void) printf("%s", p); for (i = 0; i < nargs; i++) { (void) printf("("); for (i = 0, argp = stp->tts_scarg; i < nargs; i++, argp++) { (void) printf("%#llx", *argp); (void) printf("%s
ttrace(2) ttrace(2) default: (void) printf("%s\n", ev_name(stp->tts_event)); } } main(int argc, char **argv) { ttevent_t ev; ttstate_t st; pid_t pid; int pfd1[2]; int pfd2[2]; char c; --argc, ++argv; pid = atoi(*argv); ev.tte_events = TTEVT_SYSCALL|TTEVT_EXEC|TTEVT_EXIT; 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) errexit("read"); } dottrace(TT_PROC_SET_EVENT_MASK, pid, 0, (uint64_t) &ev, sizeof ev, 0); /* tell the child to exec */ if (write(pfd1[1], (void *) &c, sizeof c) != sizeof c) { errexit("write"); } (void) close(pfd1[0]); (void) close(pfd1[1]); (void) close(pfd2[0]); (void) close(pfd2[1]); } dottrace(TT_PROC_CONTINUE, pid, 0, 0, 0, 0); for (;;) { int rval = ttrace_wait(pid, 0, TTRACE_WAITOK, &st, sizeof st); if (rval < 0) { errexit("ttrace_wait"); } show_event(&st); if (st.
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).
tuneinfo2(2) tuneinfo2(2) NAME tuneinfo2() - retrieve detailed information about kernel tunable parameters SYNOPSIS #include int tuneinfo2(int version, const char *tunable, tuneinfo2_t *buf, size_t *bufsize); TUNEINFO_STRING(tunable, string) 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.
tuneinfo2(2) tuneinfo2(2) number of processes on the system) minus 5. However, the minimum value returned for max- uprc may very well be less than the number of processes that some user currently has. uint64_t ti_flags; A bitmask of zero or more of the following flags: TIF_CANSET TIF_DYNAMIC The value of this parameter can be changed using settune() . TIF_SIGNED The values, minima and maxima, for this parameter should be interpreted as signed quantities.
tuneinfo2(2) tuneinfo2(2) ... } /* 3. Query the data: */ count = tuneinfo2(TUNEINFO_VERSION, NULL, buf, &bufsize); if (count < 0) { ... } /* 4. Print the names of all tunables: */ for (i = 0; i < count; i++) { char *name = TUNEINFO_STRING(&buf[i], ti_name); puts(name); } WARNINGS Applications and application modules must not share tuneinfo2_t structures unless it is certain that the value of TUNEINFO_VERSION, specified in the header file, is the same for all modules and involved.
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 cmask 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(), umount2() - unmount a file system SYNOPSIS #include int umount(const char *name); int umount2(const char *name, int flags); DESCRIPTION umount() requests that a previously mounted file system contained on the block special device identified by name be unmounted. umount2() requests that a previously mounted file system contained on the block special device identified by name be unmounted in the manner described in flags. name is a pointer to a path name.
umount(2) umount(2) [ENOTBLK] name is not a block special device. [ENOTDIR] A component of name is not a directory. [ENXIO] The device associated with name does not exist. [EPERM] The effective user ID of the process is not that of a user with appropriate privileges. SEE ALSO mount(1M), mount(2), privileges(5).
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) uname(2) n Successful completion. n is a nonnegative value. -1 Failure. errno is set to indicate the error. The uname() function may return truncated results when the non-expanded version of the utsname structure is used. See WARNINGS. ERRORS If uname() or setuname() fails, errno is set to one of the following values. [EFAULT] name points to an illegal address. The reliable detection of this error is implementation dependent.
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) In either of the above cases, the file system should be checked using fsck (see fsck(1M)). To avoid these types of problems, use rmdir() instead (see rmdir(2)). SEE ALSO rm(1), close(2), link(2), open(2), rmdir(2), remove(3C), privileges(5). 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) See privileges(5) for more information about privileged access on systems that support fine-grained privileges. SEE ALSO touch(1), stat(2), privileges(5). 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) function, for example), it is likely that the parent and child processes will be killed with signal SIGSEGV or SIGBUS . In the [vfork ,exec ] window, a call to signal() (see signal(2) that installs a catching function can affect handling of the signal by the parent. The parent is not affected if the handling is being set to SIG_DFL or SIG_IGN , or if sigaction() is used (see sigaction(2)). AUTHOR vfork() was developed by the University of California, Berkeley.
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_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. Notes The MOUNT_NFS type is no longer supported through this interface.
vfsmount(2) vfsmount(2) (TO BE OBSOLETED) 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. Obsolescent Interfaces vfsmount() is to be obsoleted at a future date. AUTHOR vfsmount() was developed by HP and Sun Microsystems, Inc.
wait(2) wait(2) NAME wait(), waitpid() - wait for child process to stop or terminate SYNOPSIS #include #include pid_t wait( int *stat_loc ); pid_t waitpid( pid_t pid , int *stat_loc , int options ); DESCIPTION The wait() and waitpid() functions obtain status information pertaining to one of the caller’s child processes. Various options permit status information to be obtained for child processes that have terminated or stopped.
wait(2) wait(2) HP-UX EXTENSION: If and only if this flag is set, waitpid() or wait3() (see wait3(2)) returns information on child or attached processes that are stopped because they received a SIGTTIN , SIGTTOU , SIGTSTP or SIGSTOP signal, and whose status has not yet been reported. Regardless of this flag, status is returned for child or attached processes that have terminated or are stopped and traced and whose status has not yet been reported.
wait(2) wait(2) If the information pointed to by stat_loc was stored by a call to waitpid() that specified the WUNTRACED and WCONTINUED flags, exactly one of the macros WIFCONTINUED(*stat_loc), WIFEXITED(* stat_loc ), WIFSIGNALED(*stat_loc ), and WIFSTOPPED(* stat_loc ) evaluates to a nonzero value.
wait(2) wait(2) WARNINGS HP-UX EXTENSION: The operation of wait() , waitpid() is affected if the SIGCLD signal is set to SIG_IGN (see the WARNINGS section of signal(5)). Signal handlers that cause system calls to be restarted can affect the [EINTR] condition (see bsdproc(3C) and sigaction(2)). APPLICATION USAGE Threads Considerations In a multithreaded application, only the calling thread is suspended by wait() , waitpid() call.
wait3(2) wait3(2) NAME wait3(), wait4() - wait for child process to change state SYNOPSIS #include pid_t wait3 (int *stat_loc, int options, struct rusage *resource_usage); pid_t wait4 (pid_t pid, int *stat_loc, int options, struct rusage *resource_usage); DESCRIPTION The wait3() and wait4() functions allow the calling process to obtain various status information for a caller’s child process based on the options specified.
wait3(2) wait3(2) The resource_usage argument points to the resource utilization structure. APPLICATION USAGE Threads Considerations In a multi-threaded application, only the calling thread is suspended by wait3() and wait4() . The wait3() and wait4() functions will not return until all threads in the process have reached the desired state. For example, wait3() and wait4() will not return until all threads have terminated.
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 system-dependent maximum number of bytes that a pipe or FIFO can store is PIPSIZ as defined in . • The minimum value of PIPSIZ on any HP-UX system is 8192. When writing a pipe with the O_NDELAY or O_NONBLOCK file status flag set, the following apply: • If nbyte is less than or equal to PIPSIZ and sufficient room exists in the pipe or FIFO , the write() succeeds and returns the number of bytes written.
write(2) write(2) performed by the owner or a user who has appropriate privileges, the behavior is file-system dependent. In some file systems, the write clears the set-user-ID, set-group-ID, and sticky bits on a nondirectory file. In other file systems, the write does not clear these bits on a nondirectory file. For directories, write() does not clear the set-user-ID, set-group-ID, and sticky bits.
write(2) write(2) [EIO] A physical I/O error has occurred. [EIO] The process is a member of a background process group attempting to write to its controlling terminal. TOSTOP is set, the process is neither ignoring nor blocking SIGTTOU , and the process group of the process is orphaned. This error may also be returned under implementation-dependent conditions. [ENOLCK] The system record lock table is full, preventing the write from sleeping until the blocking record lock is removed.
write(2) write(2) SEE ALSO mkfs(1M), chmod(2), creat(2), dup(2), fcntl(2), getrlimit(2), lockf(2), lseek(2), open(2), pipe(2), ulimit(2), ustat(2), privileges(5), signal(5), , , , . STANDARDS CONFORMANCE write() : AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1, POSIX.