AT&T UNIX™PC Unix System V Users Manual - tenox
AT&T UNIX™PC Unix System V Users Manual - tenox AT&T UNIX™PC Unix System V Users Manual - tenox
LOCKF (3C) LOCKF (3C) F _LOCK and F _TLOCK requests differ only by the action taken if the resource is not available. F _LOCK will cause the calling process to sleep until the resource is available. F _TLOCK will cause the function to return a -1 and set errno to [EACCES] error if the section is already locked by another process. F _ULOCK requests may, in whole or in part, release one or more locked sections controlled by the process. When sections are not fully released, the remaining sections are still locked by the process. Releasing the center section of a locked section requires an additional element in the table of active locks. If this table is full, an [EDEADLK] error is returned and the requested section is not released. A potential for deadlock occurs if a process controlling a locked resource is put to sleep by accessing another process's locked resource. Thus calls to lockf or fcntl scan for a deadlock prior to sleeping on a locked resource. An error return is made if sleeping on the locked resource would cause a deadlock. Sleeping on a resource is interrupted with any signal. The alarm(2) command may be used to provide a timeout facility in applications which require this facility. The lockf utility will fail if one or more of the following are true: [EBADF] Fildes is not a valid open descriptor. [EACCESJ /� Cmd is F _TLOCK or F _TEST and the section is already locked by another process. [EDEADLKJ Cmd is F _LOCK and a deadlock would occur. Also the cmd is either F _LOCK, F _TLOCK, or F _ULOCK and the number of entries in the lock table would exceed the number allocated on the system. SEE ALSO chmod(2), close(2), creat(2), fcntl(2), intro(2), read(2), write(2) DIAGNOSTICS Upon successful completion, a value of 0 is returned. Otherwise, a value of - 1 is returned and errno is set to indicate the error. WARNINGS Unexpected results may occur in processes that do buffering in the user address space. The process may later read/write data which is/was locked. The standard 1/0 pacakage is the most common source of unexpected buffering. 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. - 2 -
LOGNAME ( 3X ) LOGNAME ( 3X ) NAME logname - return login name of user SYNOPSIS char *logn&me( ) DESCRIPTION Logname returns a pointer to the null-terminated login name; it extracts the $LOGNAME variable from the user's environment. This routine is kept in /lib/libPW.&. FILES /etc/profile SEE ALSO env(l), login(lM), profile(4), environ(5). BUGS The return values point to static data whose content is overwritten by each call. This method of determining a login name is subject to forgery. - 1 -
- Page 865 and 866: GETGRENT ( 3C ) GETGRENT ( 3C ) NAM
- Page 867: GETLOGIN ( 3C ) GETLOGIN ( 3C ) NAM
- Page 870 and 871: GETOPT (3C) } SEE ALSO getopt(l). e
- Page 873 and 874: GETPENT (3) (AT&T UNIX PC only ) GE
- Page 875: GETPW ( 3C ) GETPW ( 3C ) NAME getp
- Page 878 and 879: GETPWENT ( 3C ) GETPWENT ( 3C ) par
- Page 881 and 882: GETUT ( 3C ) GETUT ( 3C ) NAME getu
- Page 883 and 884: HSEARCH ( 3C ) HSEARCH ( 3C ) NAME
- Page 885 and 886: HYPOT ( 3M ) HYPOT (3M) NAME hypot
- Page 887: L3TOL (3C) L3TOL (3C) NAME 13tol, l
- Page 890 and 891: (�
- Page 893: LDFHREAD ( 3X ) LDFHREAD ( 3X ) NAM
- Page 897 and 898: LDLSEEK ( 3X ) LDLSEEK ( 3X ) NAME
- Page 899 and 900: LDOHSEEK ( 3X ) (not on PDP-11) LDO
- Page 901 and 902: LDOPEN{3X) LDOPEN { 3X) NAME ldopen
- Page 903 and 904: LDRSEEK ( 3X ) LDRSEEK ( 3X ) NAME
- Page 905: LDSHREAD ( 3X ) LDSHREAD ( 3X ) NAM
- Page 908 and 909: ,ry
- Page 910 and 911: � '"'"--
- Page 912 and 913: I!) r) ·--... .._ _ .. .
- Page 914 and 915: y I
- Page 918 and 919: I� ' .... ._ .·
- Page 920 and 921: LSEARCH ( 3C ) LSEARCH ( 3C ) unsig
- Page 922 and 923: MALLOC (3C) MALLOC (3C) M_NLBLKS Se
- Page 924 and 925: MA THERR (3M) MATHERR (3M) } BESSEL
- Page 926 and 927: () . -�
- Page 928 and 929: MEMORY (3C} MEMORY (3C) Character m
- Page 930 and 931: MENU (3T) (AT&T UNIX PC only ) MENU
- Page 932 and 933: MENU (3T) (AT&T UNIX PC only ) mite
- Page 934 and 935: MENU (3T) (AT&T UNIX PC only ) FILE
- Page 936 and 937: MESSAGE ( 3T ) ( AT&T UNIX PC only
- Page 939: MONITOR ( 3C ) MONITOR ( 3C ) NAME
- Page 943 and 944: PASTE (3T) (AT&T UNIX PC only ) PAS
- Page 945 and 946: PASTE ( 3T ) ( AT&T UNIX PC only )
- Page 947: PERROR (3C) PERROR (3C) NAME perror
- Page 950 and 951: (� / I I I I I I I I I I I I I I
- Page 952 and 953: PRINTF (3S) PRINTF (3S) A field wid
- Page 955 and 956: PUTC ( 3S ) PUTC ( 3S ) NAME putc,
- Page 957: PUTENV (3C) PUTENV (3C) NAME putenv
- Page 960 and 961: ···- ·
- Page 962 and 963: I� ·-.---·
- Page 964 and 965: ' ' .} ' 1 . ' .____.,.:
LOCKF (3C) LOCKF (3C)<br />
F _LOCK and F _TLOCK requests differ only by the action taken<br />
if the resource is not available. F _LOCK will cause the calling<br />
process to sleep until the resource is available. F _TLOCK will<br />
cause the function to return a -1 and set errno to [EACCES]<br />
error if the section is already locked by another process.<br />
F _ULOCK requests may, in whole or in part, release one or more<br />
locked sections controlled by the process. When sections are not<br />
fully released, the remaining sections are still locked by the process.<br />
Releasing the center section of a locked section requires an<br />
additional element in the table of active locks. If this table is full,<br />
an [EDEADLK] error is returned and the requested section is not<br />
released.<br />
A potential for deadlock occurs if a process controlling a locked<br />
resource is put to sleep by accessing another process's locked<br />
resource. Thus calls to lockf or fcntl scan for a deadlock prior to<br />
sleeping on a locked resource. An error return is made if sleeping<br />
on the locked resource would cause a deadlock.<br />
Sleeping on a resource is interrupted with any signal. The<br />
alarm(2) command may be used to provide a timeout facility in<br />
applications which require this facility.<br />
The lockf utility will fail if one or more of the following are true:<br />
[EBADF]<br />
Fildes is not a valid open descriptor.<br />
[EACCESJ /�<br />
Cmd is F _TLOCK or F _TEST and the section is already<br />
locked by another process.<br />
[EDEADLKJ<br />
Cmd is F _LOCK and a deadlock would occur. Also the<br />
cmd is either F _LOCK, F _TLOCK, or F _ULOCK and the<br />
number of entries in the lock table would exceed the<br />
number allocated on the system.<br />
SEE ALSO<br />
chmod(2), close(2), creat(2), fcntl(2), intro(2), read(2), write(2)<br />
DIAGNOSTICS<br />
Upon successful completion, a value of 0 is returned. Otherwise, a<br />
value of - 1 is returned and errno is set to indicate the error.<br />
WARNINGS<br />
Unexpected results may occur in processes that do buffering in the<br />
user address space. The process may later read/write data which<br />
is/was locked. The standard 1/0 pacakage is the most common<br />
source of unexpected buffering.<br />
Because in the future the variable errno will be set to EAGAIN<br />
rather than EACCES when a section of a file is already locked by<br />
another process, portable application programs should expect and<br />
test for either value.<br />
- 2 -