Algol and MCP
Algol and MCP
Announcement
o New Release • Revision o Update o New Mail Code
Title
MCP/AS ALGOL and MCP Interfaces to POSIX÷ Features Programming Reference Manual
(7011 8351–002)
This announces a retitling and reissue of the A Series ALGOL and MCP Interfaces to POSIX÷ Features Programming
Reference Manual. No new technical changes have been introduced since the HMP 1.0 and SSR 43.2 release in June
1996.
This manual describes functions used to obtain certain POSIX-related features in programs not written in the C
language. Essentially, each function mimics a C language POSIX function. Most functions call library procedures
exported by the MCPSUPPORT library.
The POSIX interface was developed by the Institute of Electrical and Electronics Engineers, Inc. (IEEE).
• United States customers, call Unisys Direct at 1-800-448-1424.
• Customers outside the United States, contact your Unisys sales office.
• Unisys personnel, order through the electronic Book Store at http://iwww.bookstore.unisys.com.
Programming Reference
Manual
Printed in USA
Priced Item 7011 8351–002
The names, places, and/or events used in this publication are not intended to correspond to any
individual, group, or association existing, living, or otherwise. Any similarity or likeness of the names,
places, and/or events with the names of any individual, living or otherwise, or that of any group or
association is purely coincidental and unintentional.
NO WARRANTIES OF ANY NATURE ARE EXTENDED BY THIS DOCUMENT. Any product or related
information described herein is only furnished pursuant and subject to the terms and conditions of a
duly executed agreement to purchase or lease equipment or to license software. The only warranties
made by Unisys, if any, with respect to the products described in this document are set forth in such
agreement. Unisys cannot accept any financial or other responsibility that may be the result of your
use of the information in this document or software material, including direct, special, or consequential
damages.
You should be very careful to ensure that the use of this information and/or software material complies
with the laws, rules, and regulations of the jurisdictions with respect to which it is used.
The information contained herein is subject to change without notice. Revisions may be issued to
advise of such changes and/or additions.
Section 1. Introduction
iv 7011 8351–002
Contents
7011 8351–002 v
Contents
vi 7011 8351–002
Contents
Glossary ....................................................................................................... 1
Index ............................................................................................................. 1
7011 8351–002 ix
Tables
x 7011 8351–002
Examples
6–1. Using POSIX Functions in an ALGOL Program .......................................... 6–10
6–2. An Equivalent C Program ....................................................................... 6–16
7011 8351–002 xi
Examples
Purpose
This manual describes functions used to obtain certain POSIX interface features in
programs not written in the C language. Essentially, each function mimics a C language
POSIX interface function. Most functions call library procedures exported by the
MCPSUPPORT library.
• POSIX_INTEGERIDS
• POSIX_NANOALARM
• POSIX_NANOSLEEP
• POSIX_SEM_CLOSE
• POSIX_SEM_DESTROY
• POSIX_SEM_GETVALUE
• POSIX_SEM_INIT
• POSIX_SEM_OPEN
• POSIX_SEM_POST
• POSIX_SEM_TRYWAIT
• POSIX_SEM_UNLINK
• POSIX_SEM_WAIT
• POSIX_SETIDS
• POSIX_SIGHANDLER
• POSIX_STRINGIDS
Scope
The functions and library procedures described in this manual are for A Series systems.
You can access them in programs to perform a variety of functions. Some of these
functions include:
Audience
This document is a reference manual intended primarily for use by programmers. It is
particularly relevant for ALGOL and NEWP programs written to be part of, or to interact
with, C language programs.
Prerequisites
You should be familiar with:
• Read the "About this Section" portion of Section 5. Table 5-1 lists the library
procedure applicable to each function.
• Use Section 5 to obtain reference information about library procedures. (Note that all
library declarations use ALGOL syntax.)
• Refer to Section 6 for representative programming examples.
All users should refer to Section 4 if they cannot find information about a particular
function. Section 4 lists unsupported POSIX interface C functions.
Notes:
1. The library procedures described in Section 5 are internal interfaces used by the
system software. These interfaces might also be of use to sophisticated application
programs. From one release to another, an internal interface might change in such
a way that programs that use the internal interface will be required to make
changes to operate correctly. Because internal interfaces are special system
interfaces, they do not adhere to the compatibility policies described in the SSR 42.3
Software Release Capabilities Overview. You should examine all programs that use
internal interfaces before installing a new release to ensure that the internal
interface has not changed.
2. Wherever possible, ALGOL programmers should use the capabilities described in
Sections 2 and 3. Normal policies support these capabilities.
Organization
This document contains six sections and an index.
Section 1. Introduction
This section provides an overview of POSIX interface functions. It describes how to
access these features in non C language programs.
7011 8351–002 xv
About This Manual
The following documents are included with the software release documentation and
provide general reference information:
• The Glossary includes definitions of terms used in this document.
• The Documentation Road Map is a pictorial representation of the Product
Information (PI) library. You follow paths through the road map based on tasks you
want to perform. The paths lead to the documents you need for those tasks. The Road
Map is available on paper and on the PI Library CD-ROM. If you know what you want
to do, but don't know where to find the information, start with the Documentation
Road Map.
• The Information Availability List (IAL) lists all user documents, online help, and
HTML files in the library. The list is sorted by title and by part number.
The following documents provide information that is directly related to the primary
subject of this publication.
If a function is . . . Then . . .
Section 3 describes all POSIX interface related functions currently supported by the
ALGOL include file.
• A table that lists all supported POSIX functions and associated MCPSUPPORT library
procedures
• A description of every applicable library procedure
Section 5 defines some POSIX functions that the ALGOL include file does not support.
ALGOL programmers can use the appropriate library procedure to access those functions.
Documentation Conventions
This document uses the following conventions:
• The term POSIX refers to the A Series POSIX implementation as described in the
POSIX User’s Guide. Therefore, the C Programming Reference Manual, Volume 2,
might categorize a referenced function as any of the following:
− “Implementation Extension”
− “POSIX”
− “X/Open”
• Terms in uppercase characters refer to POSIX functions defined in the ALGOL include
file. ACCESS and MKFIFO are two examples.
• C language semantics reference equivalent C language functions. The terms access( )
and mkfifo( ) are two examples.
Note that the C Programming Reference Manual, Volume 2, lists these functions
without trailing parenthesis. The terms access and mkfifo are two examples.
• C language #include precompiler directives are not listed in this manual.
• In Section 5, equivalent C language function names describe most of the functions
provided by MCPSUPPORT library procedures.
Section 2 describes:
• The ALGOL include file. Use this file to access POSIX functions in an ALGOL
program.
• The “rules” required to specify POSIX function or library procedure parameters and to
interpret the results.
Every description within Section 3 and Section 5 includes a reference to one of these
rules.
• Defined names and values associated with integer parameters. The ALGOL include
file defines the indicated names.
• The layout of structures passed to or from POSIX functions and library procedures.
$$ INCLUDE "SYMBOL/POSIX/ALGOL/PROPERTIES"
• Part 1
This part contains all POSIX interface related library procedure declarations and
defined SELECTOR parameter values.
• Part 2
This part provides global defines for data referenced by more than one library
procedure. Information defined here includes:
− Common constants
− Structure definitions
• Part 3
This part specifies each POSIX function and any required library procedure calls. See
Section 3 for information about these POSIX functions.
Note: Library procedure descriptions (provided in Section 5) also refer to these rules.
Call-by-reference Integer
Define this parameter as a call-by-reference integer. When the procedure is invoked, the
system evaluates the location of the actual parameter and replaces the formal parameter
with a reference to that location. Thereafter, any change in the formal parameter affects
the actual parameter within the program.
Call-by-reference Real
Define this parameter as a call-by-reference real number. When the procedure is invoked,
the system evaluates the location of the actual parameter and replaces the formal
parameter with a reference to that location. Thereafter, any change in the formal
parameter affects the actual parameter within the program.
Call-by-value Integer
Define this parameter as a call-by-value integer. A copy of the actual parameter value is
passed to the procedure. Thereafter, any change to the formal parameter has no effect
outside the procedure body.
Call-by-value Real
Define this parameter as a call-by-value real number. A copy of the actual parameter is
passed to the procedure. Thereafter, any change to the formal parameter has no effect
outside the procedure body.
An ERRNO value is set if there is not enough space to store all data, exclusive of the null
character. If all data characters are stored but there is insufficient room for the null
character, no error is set.
File
Define the applicable parameter as a file.
Path Definition
The library procedure expects a pathname containing a string of EBCDIC characters. You
must define five parameters:
3. A call-by-value integer (PATH_LEN) that specifies the length (in characters) of the
pathname string. There are two ways to express the PATH_LEN value:
Value Description
–1 Allow the MCP to calculate string length. The MCP will assume the string is null
terminated and will calculate its length. If the MCP does not detect a null character,
it sets an ERRNO value.
Defined
Value Name Description
0 NATIVE Use native platform rules to evaluate the pathname string when
searching for an existing file or creating a new file. See the File
Attributes Programming Reference Manual for details.
1 POSIX Use POSIX interface defined rules to evaluate the pathname string
when searching for an existing file or creating a new file. See the
POSIX User’s Guide for specific information on these rules.
• The MCP can normally store the beginning of a “large” structure in a smaller array
space. It ignores the unstored portion of the large structure and does not provide an
error.
• An error occurs only if a member is partially stored.
If the structure contains a character array, its length is fixed in the definition of the
structure. This length is passed in a member declared just before the character array. The
MCP sets an ERRNO condition if the defined length does not accommodate the character
string (including a terminating null character).
Table 2–1 defines the information required in each of the required INFOn parameters.
The sa_handler address (defined by the INFO2 parameter) is always passed to the library
procedure. The INFO3_SIGINFOF bit (defined in the INFO3 parameter) specifies what
additional arguments should be passed.
Parameter Description
INFO1 An integer input parameter specifying the version and signal type
(the current version value is 0). This word breaks down as
follows:
[23:08] INFO1_VERSIONF
[07:08] INFO1_SIGNALF
INFO1_SIGNALF corresponds to the si_signo member of the
SIGINFO_T structure.
INFO2 An integer input parameter containing the value of the sa_handler
word of the parent procedure’s ACT array. See “DISP parameter”
later in this section for a description of possible values.
INFO3 An integer input parameter containing additional information about
the signal state. This word breaks down as follows:
[37:01] INFO3_SIGINFOF
[36:01] INFO3_HARDWAREGENF
[35:12] INFO3_CODEF
[23:24] INFO3_ERRF
INFO3_CODEF corresponds to the si_code member of the
SIGINFO_T structure.
INFO3_ERRF corresponds to the si_errno member of the
SIGINFO_T structure.
INFO4 An integer input parameter containing the process ID of the
process causing the signal. This parameter corresponds to the
si_pid member of the SIGINFO_T structure.
INFO5 An integer input parameter containing the user ID. This parameter
corresponds to the si_uid member of the SIGINFO_T structure.
INFO6 Not used.
INFO7 Not used.
INFO8 Not used.
INFO9 Not used.
INFO10 Not used.
ERRNO
ERRNO must be declared as the last item in the formal parameter list of all POSIX
interface related functions and library procedures. It is declared as a call-by-reference
integer.
If an error occurs during the execution of a procedure, the calling process is normally
notified in two ways:
• The procedure returns an error result, usually –1 (see “Result (integer or real)” later in
this section)
• ERRNO is set to some non-zero code to identify the error
There are two ways to determine the meaning of a non-zero ERRNO code:
ERRNO
Code Error Description
0 EOK No error.
1 EDOM Domain error.
ERRNO
Code Error Description
ERRNO
Code Error Description
ERRNO
Code Error Description
ERRNO
Code Error Description
ERRNO
Code Error Description
ERRNO
Code Error Description
Refer to the C Programming Reference Manual, Volume 2: Headers and Functions, for
appropriate information. For each function description, the Returns subsection describes
the meaning of all possible result codes.
AMODE Parameter
ALGOL Function or Library Procedure Reference
AMODE is associated with the
• ACCESS function
• POSIX_ACCESS library procedure
Description
The following table lists valid AMODE parameter integers and associated defined names.
The defined names are valid only with the ACCESS function.
Defined Name
Integer (Include File) Description
Description
The following table lists valid CMD parameter integers and associated defined names.
Defined Name
Integer (Include File) Description
• SEMCTL function
• MCPX_SEMCTL library procedure
Description
The following table lists valid CMD parameter integers and associated defined names. The
defined names are valid only with the ALGOL SEMCTL function.
Defined Name
Integer (Include File) Description
DISP Parameter
ALGOL Function or Library Procedure Reference
DISP is associated with the
• SIGNAL function
• SIGSET function
• POSIX_SIGHANDLER library procedure
Description
The following table lists valid DISP parameter integers and associated defined names. The
defined names are valid only with the SIGNAL and SIGSET functions.
Defined Name
Integer (Include File) Description
FLOCK Structure
ALGOL Function or Library Procedure Reference
The POSIX_FCNTL library procedure passes the FLOCK structure.
Description
The following table defines the contents of the FLOCK structure.
Word
Offset Member Description
GROUP Structure
ALGOL Function or Library Procedure Reference
The GROUP structure is passed by the
• GETGRGID function
• GETGRNAM function
• POSIX_GETGRINFO library procedure
Description
The following table defines the contents of the GROUP structure.
Word
Offset Member Description
HOW Parameter
ALGOL Function or Library Procedure Reference
HOW is associated with the
• SIGPROCMASK function
• POSIX_SIGHANDLER library procedure
Description
The following table lists valid HOW parameter integers and associated defined names.
The defined names are valid only with the SIGPROCMASK function.
Defined Name
Integer (Include File) Description
INFO Parameter
ALGOL Function or Library Procedure Reference
The POSIX_SETIDS library procedure uses the INFO parameter.
Description
The following table defines INFO parameter bit assignments for the umask( ) function
(SELECTOR parameter value of 5). For other functions, the INFO parameter contains a
user ID, group ID, or process group ID.
Note: When a permission bit is masked out, it CANNOT be set when the file is created.
Description
INTARG provides supporting data for three POSIX_FCNTL library procedure functions
(the CMD parameter specifies the function to be performed). The following table
describes INTARG parameter usage for these functions.
MODE Parameter
ALGOL Function or Library Procedure Reference
SEMFLG is associated with the
• SEM_OPEN function
• POSIX_SEM_OPEN library procedure
Description
The following table defines MODE parameter bit assignments.
MCPSTAT Structure
ALGOL Function or Library Procedure Reference
The MCPSTAT structure is passed by the
• MCPSTAT function
• POSIX_FILESTATUS library procedure
Description
The following table defines the contents of the MCPSTAT structure.
Word
Offset Member Description
• PATHCONF function
• POSIX_PATHCONF library procedure
Description
The following table lists valid NAME parameter integers and associated defined names.
The defined names are valid only with the PATHCONF function.
Defined Name
Integer (Include File) Description
• SYSCONF function
• POSIX_SYSCONF library procedure
Description
The following table lists valid NAME parameter integers and associated defined names.
The defined names are valid only with the SYSCONF function.
Defined Name
Integer (Include File) Description
Description
File closing OPTION values are listed in the following table. The specified value is passed
to the FIBCLOSE routine; it is effective only if the last file descriptor referencing the open
file description is being closed. For option descriptions, see the CLOSE statement
description within the ALGOL Programming Reference Manual, Volume 1: Basic
Implementation.
Description
File opening OPTION values are listed in the following table. The indicated OPTION
values are passed to the FIBOPEN routine when opening or creating a file. For more
detailed descriptions of these options, see the OPEN statement description in the ALGOL
Programming Reference Manual, Volume 1: Basic Implementation.
[38:01] PO_TRUNCATEF When set, this flag causes an opened existing file to be
truncated to a length of zero under certain conditions.
Basically, truncation occurs if FILEUSE is either OUT or IO;
there is no duplicate file; no other process has the file open;
and the file is not a code file.
[07:08] PO_OPENTYPEF This field contains a value that specifies one of the following
encoded open types:
0 POO_WAITV
This option is equivalent to the existing (non-POSIX)
WAIT option.
1 POO_ATENDV
This option is equivalent to the existing (non-POSIX)
ATEND option.
2 POO_AVAILABLEV
This option is equivalent to the existing (non-POSIX)
AVAILABLE option.
3 POO_CONDITIONALV
This option modifies the open process as follows:
4 POO_MUSTBENEWV
This option modifies the open process. If NEWFILE is
true and the file already exists, an error is returned and
a new file is not created.
5 POO_OFFERV
This option is equivalent to the existing (non-POSIX)
OFFER option.
• WAITPID function
• POSIX_WAITPID library procedure
Description
The following table lists valid OPTION parameter integers and associated defined names.
The defined names are valid only with the WAITPID function.
Defined Name
Bit (Include File) Description
PASSWD Structure
ALGOL Function or Library Procedure Reference
The PASSWD structure is passed by the
• GETPWGID function
• GETPWNAM function
• POSIX_GETPWINFO library procedure
Description
The following table defines the contents of the PASSWD structure.
Word
Offset Member Description
• KILL function
• POSIX_SIGNALHANDLER library procedure
Description
The following table lists valid PID parameter values and the function associated with each.
Integer Function
>0 Send signal to the process that has a process ID equal to PID.
0 Send signal to all processes that:
• Have a process group ID equal to the calling process’s process group ID.
• Are NOT system processes.
–1 Not specified.
<–1 Send signal to all processes that:
• Have a process group ID equal to the absolute value of PID.
• Are NOT system processes.
• WAITPID function
• POSIX_WAITPID library procedure
Description
The following table lists valid PID parameter integers and associated functions. The
defined name (PIDANYV) is valid only with the WAITPID function.
Defined Name
Integer (Include File) Function
SEMBUF Structure
ALGOL Function or Library Procedure Reference
The SEMBUF structure is passed by the
• SEMOP function
• MCPX_SEMOP library procedure
Description
The following table defines the contents of the SEMBUF structure.
Word
Offset Member Description
[12:01] SEM_UNDO
(set up adjust on exit entry)
[16:01] IPC_CREAT
(create entry if key does not exist)
[17:01] IPC_EXCL
(fail if key exists)
[18:01] IPC_NOWAIT
(return error if request must wait)
SEMFLG Parameter
ALGOL Function or Library Procedure Reference
SEMFLG is associated with the:
• SEMGET function
• MCPX_SEMGET library procedure
Description
The following table defines valid SEMFLG parameter bit assignments and their meaning.
Defined names are valid only with the SEMGET function.
SEMID_DS Structure
ALGOL Function or Library Procedure Reference
The SEMID_DS structure is passed by the
• SEMCTL function
• MCPX_SEMCTL library procedure
Description
The following table defines the contents of the SEMID_DS structure.
Word
Offset Member Description
SIG Parameter
ALGOL Function or Library Procedure Reference
SIG is associated with the
• KILL function
• RAISE function
• SIGACTION function
• SIGADDSET function
• SIGDELSET function
• SIGHOLD function
• SIGIGNORE function
• SIGISMEMBER function
• SIGNAL function
• SIGPAUSE function
• SIGRELSE function
• SIGSET function
• POSIX_SIGHANDLER library procedure
Description
The following table indicates the signal type associated with each SIG parameter value.
SIGACTION Structure
ALGOL Function or Library Procedure Reference
The SIGACTION structure is passed by the:
• SIGACTION function
• POSIX_SIGHANDLER library procedure
Description
The following table defines the contents of the SIGACTION structure.
Word
Offset Member Description
SIGINFO_T Structure
ALGOL Function or Library Procedure Reference
The SIGINFO_T structure is passed by the ACT_PROC procedure. ACT_PROC is used by
the
• SIGACTION function
• SIGNAL function
• SIGSET function
• POSIX_SIGHANDLER library procedure
Description
The following table defines the contents of the SIGINFO_T structure.
Word
Offset Member Description
STAT Structure
ALGOL Function or Library Procedure Reference
The STAT structure is passed by the
• STAT function
• POSIX_FILESTATUS library procedure
Description
The following table defines the contents of the STAT structure.
Word
Offset Member Description
Word
Offset Member Description
0 = Traditional
1 = POSIX
STATUS Parameter
ALGOL Function or Library Procedure Reference
STATUS is associated with
• WAITP function
• WAITPID function
• POSIX_WAITPID library procedure
Description
The STATUS parameter (or STAT_LOC parameter of the POSIX_WAITPID library
procedure) references the memory location where a child process’s status word is stored.
This word indicates appropriate stopped or termination status for a child process.
TMS Structure
ALGOL Function or Library Procedure Reference
The TMS structure is passed by the
• TIMES function
• POSIX_TIMES library procedure
Description
The following table defines the contents of the TMS structure.
Word
Offset Member Description
0 TMS_UTIME Specifies the CPU time (in ticks) required for execution of
user instructions by this process.
1 TMS_STIME Specifies the CPU time (in ticks) used by the system on
behalf of this process.
2 TMS_CUTIME Specifies the accumulated TMS_UTIME and TMS_CUTIME for
all child processes.
3 TMS_CSTIME Specifies the accumulated TMS_STIME and TMS_CSTIME for
all child processes.
4 TMS_ITIME Specifies the I/O time (in ticks) for this process.
5 TMS_CITIME Specifies the accumulated I/O time (in ticks) for all child
processes.
UTSNAME Structure
ALGOL Function or Library Procedure Reference
The UTSNAME structure is passed by the
• UNAME function
• POSIX_UNAME library procedure
Description
The following table defines the contents of the UTSNAME structure. Each member is a
string of up to 72 characters terminated with a null character.
Word
Offset Member Description
Word
Offset Member Description
This document does not provide detailed descriptions of each function. Instead, it usually
references an equivalent C language function. See the C Programming Reference
Manual, Volume 2: Headers and Functions, for details about these functions.
Your program does not require library procedure declarations. The include file
automatically provides all POSIX interface related library procedure declarations.
ACCESS
ALGOL Syntax
ACCESS (PATH, PATH_OFF, PATH_LEN, PATH_TYPE, PATH_SEARCHRULE,
AMODE, ERRNO);
Description
The ACCESS function determines whether the calling process has a specified access
permission for a particular file. The AMODE parameter must contain a value that defines
a particular file access permission. If a file and a directory share the specified filename,
this function determines access permission for the directory.
Comparison to C Function
Functional Differences
An AMODE parameter value of F_OK is not recognized; file existence is always checked.
ALARM
ALGOL Syntax
ALARM (SECS, ERRNO);
Description
The ALARM function causes the system to send a signal (type SIGALRM) to the calling
process after the specified number of seconds have elapsed. If SECS is zero, this function
cancels any previously specified ALARM function.
Comparison to C Function
Functional Differences
None
CHDIR
ALGOL Syntax
CHDIR (PATH, PATH_OFF, PATH_LEN, PATH_TYPE, PATH_SEARCHRULE, ERRNO);
Description
The CHDIR function causes a specified pathname to become the current working
directory.
Comparison to C Function
Functional Differences
None
CHMOD
ALGOL Syntax
CHMOD (PATH, PATH_OFF, PATH_LEN, PATH_TYPE, PATH_SEARCHRULE, MODE,
ERRNO);
Description
Note: The CHMOD function does not currently work with directories. Directory
support is planned for a future release.
The CHMOD function alters the SECURITYMODE file attribute for a specified disk file.
The SECURITYMODE attribute is an encoded value that contains the following file-
specific information:
• Owner class, Group class, and Other class file access permission flags
• Guard file flags
• Set Usercode flag
• Set Groupcode flag
CHMOD is equivalent to the following C function:
Comparison to C Function
Functional Differences
None
CHOWN
ALGOL Syntax
CHOWN (PATH, PATH_OFF, PATH_LEN, PATH_TYPE, PATH_SEARCHRULE, OWNER,
GROUP, ERRNO);
Description
Note: The CHOWN function does not currently work with directories. Directory
support is planned for a future release.
The CHOWN function changes the OWNER and/or GROUP file attribute of a specified file
to the ID values defined by the function parameters. The specified user and group IDs
map to attributes in the USERDATAFILE.
Comparison to C Function
Functional Differences
None
EXECVE
ALGOL Syntax
EXECVE (PATH, PATH_OFF, PATH_LEN, PATH_TYPE, PATH_SEARCHRULE, ARGV,
ARGVINDX, ARGVINDX_OFF, ARGVINDX_LEN, ARGVSZ, ARGVSZ_OFF,
ARGVSZ_LEN, ENVP, ENVPINDX, ENVPINDX_OFF, ENVPINDX_LEN,
ENVPSZ, ENVPSZ_OFF, ENVPSZ_LEN, ERRNO);
Description
The EXECVE function replaces the current process image with a new process image and
executes a new code file. The PATH array specifies the pathname of the new executable
file, the ARGV array specifies one or more strings of program arguments, and the ENVP
array specifies zero or more strings of environment variables.
int execve (const char *path, char *const argv[ ], char *const
envp[ ]);
Comparison to C Function
Functional Differences
None
FORK
ALGOL Syntax
FORK (ERRNO);
Description
The FORK function creates a new process. The new process (known as a child process)
inherits many attributes from the creating process.
Comparison to C Function
Functional Differences
The ALGOL and C-based FORK functions are essentially identical.
• It modifies program control words (PCWs), stuffed indirect reference words (SIRWs),
and data descriptors in active LIBRARY stack frames. The modified words do not
have pointers into the library D1 or D2 stacks.
• It modifies indirect reference words (IRWs) that previously pointed into the forking
(original) stack. The modified IRWs point into the new stack.
• It copies messages with mom descriptors in the forking stack. The new messages
have mom descriptors in the new stack.
GETCWD
ALGOL Syntax
GETCWD (STR, OFFSET, MAX, ERRNO);
Description
The GETCWD function obtains a string that represents the absolute pathname of the
current working directory.
Comparison to C Function
Functional Differences
The ALGOL function receives a different result.
GETEGID
ALGOL Syntax
GETEGID (ERRNO);
Description
The GETEGID function returns the effective group ID of the calling process.
Comparison to C Function
Functional Differences
None
GETEUID
ALGOL Syntax
GETEUID (ERRNO);
Description
The GETEUID function returns the effective user ID of the calling process.
Comparison to C Function
Functional Differences
None
GETGID
ALGOL Syntax
GETGID (ERRNO);
Description
The GETGID function returns the real group ID of the calling process.
Comparison to C Function
Functional Differences
None
GETGRGID
ALGOL Syntax
GETGRGID (GID, MEM, MEM_OFF, MEM_MAX, ERRNO);
Description
The GETGRGID function obtains the GROUP structure for a specified group ID. A
GROUP structure consists of:
• Group name
• Group ID
• Group member list
GETGRGID is equivalent to the following C function:
Comparison to C Function
<–1
Defined MEM array space was insufficient.
The absolute value of the negative result is
the number of words required to hold the
GROUP structure.
–1
An error occurred.
Functional Differences
The ALGOL function receives a different result.
GETGRNAM
ALGOL Syntax
GETGRNAM (NAME, NAME_OFF, NAME_LEN, MEM, MEM_OFF, MEM_MAX, ERRNO);
Description
The GETGRNAM function obtains the GROUP structure for a specified group name. A
GROUP structure consists of:
• Group name
• Group ID
• Group member list
GETGRGNAM is equivalent to the following C function:
Comparison to C Function
Functional Differences
The ALGOL function receives a different result.
GETGROUPS
ALGOL Syntax
GETGROUPS (GROUPLIST, GROUPLIST_OFF, GROUPLIST_MAX, ERRNO);
Description
The GETGROUPS function obtains all supplementary group IDs for the calling process.
Comparison to C Function
Functional Differences
None.
GETLOGIN
ALGOL Syntax
GETLOGIN (STR, OFFSET, MAX, ERRNO);
Description
The GETLOGIN function obtains the login name associated with the calling process. For
this implementation, login name and usercode are synonymous.
Comparison to C Function
Functional Differences
The ALGOL function receives a different result.
GETPGID
ALGOL Syntax
GETPGID (PID, ERRNO);
Description
The GETPGID function returns the process group ID of the process specified by PID. If
the PID parameter is 0, GETPGID returns the process group ID of the calling process.
Parameter Description
GETPGRP
ALGOL Syntax
GETPGRP (ERRNO);
Description
The GETPGRP function returns the process group ID of the calling process.
Comparison to C Function
Functional Differences
None.
GETPID
ALGOL Syntax
GETPID (ERRNO);
Description
The GETPID function returns the process ID of the calling process.
Comparison to C Function
Functional Differences
None.
GETPPID
ALGOL Syntax
GETPPID (ERRNO);
Description
The GETPPID function returns the parent process ID of the calling process.
Comparison to C Function
Functional Differences
None.
GETPWNAM
ALGOL Syntax
GETPWNAM (NAME, NAME_OFF, NAME_LEN, PASSWD, PASSWD_OFF, PASSWD_MAX,
ERRNO);
Description
The GETPWNAM function obtains the PASSWD structure associated with a specified user
name.
Comparison to C Function
Functional Differences
The ALGOL function receives a different result.
GETPWUID
ALGOL Syntax
GETPWUID (UID, PASSWD, PASSWD_OFF, PASSWD_MAX, ERRNO);
Description
The GETPWUID function obtains the PASSWD structure associated with a specified user
ID.
Comparison to C Function
Functional Differences
The ALGOL function receives a different result.
GETSID
ALGOL Syntax
GETSID (PID, ERRNO);
Description
The GETSID function returns the session ID of the process specified by PID. If the PID
parameter is 0, GETSID returns the session ID of the calling process.
Parameter Description
GETUID
ALGOL Syntax
GETUID (ERRNO);
Description
The GETUID function returns the real user ID of the calling process.
Comparison to C Function
Functional Differences
None.
GETUSERID
ALGOL Syntax
GETUSERID (STR, STR_OFF, STR_LEN, ERRNO);
Description
The GETUSERID function returns the user ID associated with the user name specified in
array STR.
Parameters
Parameter Description
GETUSERNAME
ALGOL Syntax
GETUSERNAME (UID, STR, STR_OFF, STR_MAX, ERRNO);
Description
The GETUSERNAME function returns the user name associated with a specified user ID.
The user name string is placed in array STR.
Parameters
Parameter Description
KILL
ALGOL Syntax
KILL (SIG, PID, ERRNO);
Description
The KILL function sends a signal to the process or group of processes defined by the PID
parameter. The SIG parameter specifies the signal to be sent.
Note: The calling process must have sending permission to send a signal to any
process.
Comparison to C Function
Functional Differences
None.
MKFIFO
ALGOL Syntax
MKFIFO (PATH, PATH_OFF, PATH_LEN, PATH_TYPE, PATH_SEARCHRULE, MODE,
DEV_INFO, ERRNO);
Description
The MKFIFO function creates a new FIFO special file with a filename defined by the
pathname specified in the PATH array. The MODE parameter defines the permission bits
for this file.
Comparison to C Function
EBCDICV
ASCIIV
ERRNO – ERRNO rule.
<result> <result> Integer result.
Functional Differences
None.
NICE
ALGOL Syntax
NICE (VAL, ERRNO);
Description
The NICE function changes the running (current) priority of the calling process. The
following formula defines the running priority and nice value relationship:
To change the running priority, the NICE function generates a new nice value. The
function’s VAL parameter (a positive or negative integer) is added to the existing nice
value to form the new value.
Nice values can range between 0 (the original nice value of a process) and 255. An
attempt to modify the nice value outside of these limits has the following effect:
• If the nice value is made negative, a –1 result is returned and the EPERM value is set
in ERRNO.
• If the nice value is made higher than 255, results are unspecified.
A process’s running priority can range between 0 and its original priority value.
Parameters
Parameter Description
PATHCONF
ALGOL Syntax
PATHCONF (PATH, PATH_OFF, PATH_LEN, PATH_TYPE, PATH_SEARCHRULE, NAME,
ERRNO);
Description
The PATHCONF function returns information about a configurable variable for an open
file. This file is specified by the path definition. The NAME parameter specifies a
configurable variable.
Comparison to C Function
Functional Differences
None
PAUSE
ALGOL Syntax
PAUSE (ERRNO);
Description
The PAUSE function suspends the calling process. The process remains suspended until
receipt of a signal that does one of the following:
Comparison to C Function
Functional Differences
None
RAISE
ALGOL Syntax
RAISE (SIG, ERRNO);
Description
The RAISE function sends a signal to the calling process. The SIG parameter specifies the
signal type.
Comparison to C Function
Functional Differences
None
SEM_CLOSE
ALGOL Syntax
SEM_CLOSE (SEM, ERRNO);
Description
The SEM_CLOSE function closes a named semaphore that is currently open to the calling
process. A closed semaphore is no longer available to the this process. However, it is not
removed from the system.
Comparison to C Function
Functional Differences
None
SEMCTL
ALGOL Syntax
SEMCTL (SEMID, SEMNUM, CMD, VAL, ARG, ARG_OFF, ARG_LEN, ERRNO);
Description
The SEMCTL function provides a set of control operations for an X/Open defined
semaphore or semaphore set. The CMD parameter specifies the operation (command) to
be performed.
Comparison to C Function
Functional Differences
None
SEM_DESTROY
ALGOL Syntax
SEM_DESTROY (SEM, ERRNO);
Description
The SEM_DESTROY function removes an unnamed semaphore from the system. The SEM
parameter specifies this semaphore.
Comparison to C Function
Functional Differences
None
SEMGET
ALGOL Syntax
SEMGET (KEY, NSEMS, SEMFLG, ERRNO);
Description
The SEMGET function performs either of the following operations relative to X/Open
defined semaphores:
Comparison to C Function
IPC_PRIVATE
NSEMS nsems Call-by-value integer.
SEMFLG semflg Call-by-value integer.
Functional Differences
None
SEM_GETVALUE
ALGOL Syntax
SEM_GETVALUE (SEM, SVAL, ERRNO);
Description
The SEM_GETVALUE function retrieves the value of the named or unnamed semaphore
indicated by the SEM parameter. The state or value of the semaphore is not affected.
Comparison to C Function
Functional Differences
None
SEM_INIT
ALGOL Syntax
SEM_INIT (SEM, PSHARED, VAL, ERRNO);
Description
The SEM_INIT function initializes an unnamed semaphore. An initialized semaphore is
available for use.
Comparison to C Function
Functional Differences
None
SEMOP
ALGOL Syntax
SEMOP (SEMID, SOPS, SOPS_OFF, SOPS_MAX, NSOPS, ERRNO);
Description
The SEMOP function performs user-specified operations on a specified group of X/Open
defined semaphores. Information in the SOPS array defines this operation.
Comparison to C Function
Functional Differences
None
SEM_OPEN
ALGOL Syntax
SEM_OPEN (NAME, NAME_OFF, NAME_LEN, OFLAG, MODE, VAL, ERRNO);
Description
The SEM_OPEN function opens the named semaphore referred to in the NAME array. The
function can do either of the following:
Comparison to C Function
Functional Differences
None
SEM_POST
ALGOL Syntax
SEM_POST (SEM, ERRNO);
Description
The SEM_POST function unlocks the named or unnamed semaphore indicated by the SEM
parameter. An unlock operation increments the value of a semaphore by 1. A semaphore
is unlocked when it has a value greater than 0.
If a process is waiting to lock the semaphore, it can proceed once the semaphore’s value is
greater than 0.
Comparison to C Function
Functional Differences
None
SEM_TRYWAIT
ALGOL Syntax
SEM_TRYWAIT (SEM, ERRNO);
Description
The SEM_TRYWAIT function attempts to decrement the value of the named or unnamed
semaphore referred to by the SEM parameter. This operation occurs only if the
semaphore's value is greater than 0. A semaphore is locked when its value is 0.
Comparison to C Function
Functional Differences
None
SEM_UNLINK
ALGOL Syntax
SEM_UNLINK (NAME, NAME_OFF, NAME_LEN, ERRNO);
Description
The SEM_UNLINK function deletes the name of a semaphore from the system table. Once
unlinked, the named semaphore cannot be accessed by subsequent open operations.
Comparison to C Function
Functional Differences
None
SEM_WAIT
ALGOL Syntax
SEM_WAIT (SEM, ERRNO);
Description
The SEM_WAIT function operates on a semaphore referenced by the SEM parameter as
indicated in the following chart. A semaphore is locked when its value is 0.
If the named or
unnamed
semaphore value
is . . . Then SEM_WAIT . . .
Comparison to C Function
Functional Differences
None
SETGID
ALGOL Syntax
SETGID (GID, ERRNO);
Description
The SETGID function changes the effective group ID of the calling process.
Comparison to C Function
Functional Differences
None
SETPGID
ALGOL Syntax
SETPGID (PID, PGID, ERRNO);
Description
The SETPGID function changes the process group ID of a specified process (defined by
PID) to a specified value (defined by PGID). This function can be used to do either of the
following:
• Create a new process group within the session of the calling process.
• Move a specified process to another process group.
SETPGID is equivalent to the following C function:
Comparison to C Function
Functional Differences
None
SETPGRP
ALGOL Syntax
SETPGRP (ERRNO);
Description
If the calling process is not already a session leader, the SETPGRP function establishes it
as a session leader and process group leader. SETPGRP establishes the following
environment:
• A new session exists. The calling process is session leader. There are no other
processes in the session.
• A new process group exists. The calling process is its process group leader. There
are no other processes in the process group.
• The new process group ID is the process ID of the calling process.
• There is no controlling terminal.
There is no equivalent C language function.
Parameters
Parameter Description
SETSID
ALGOL Syntax
SETSID (ERRNO);
Description
The SETSID function establishes the calling process as a session leader and process group
leader. SETSID is identical to the SETPGRP function.
Comparison to C Function
Functional Differences
None
SETUID
ALGOL Syntax
SETUID (UID, ERRNO);
Description
The SETUID function changes the effective user ID of the calling process.
Comparison to C Function
Functional Differences
None
SIGACTION
ALGOL Syntax
SIGACTION (SIG, ACT_PROC, ACT, ACT_OFF, ACT_LEN, OACT, OACT_OFF,
OACT_MAX, ERRNO);
Description
The SIGACTION function allows the calling process to specify and/or examine the action
associated with an indicated signal type.
Comparison to C Function
Functional Differences
None
SIGADDSET
ALGOL Syntax
SIGADDSET (SET, SIG, ERRNO);
Description
The SIGADDSET function adds a signal (specified by the SIG parameter) to a signal set
(specified by the SET parameter).
Comparison to C Function
Functional Differences
None
SIGDELSET
ALGOL Syntax
SIGDELSET (SET, SIG, ERRNO);
Description
The SIGDELSET function removes a signal type (specified by the SIG parameter) from a
signal set (specified by the SET parameter).
Comparison to C Function
Functional Differences
None
SIGEMPTYSET
ALGOL Syntax
SIGEMPTYSET (SET, ERRNO);
Description
The SIGEMPTYSET function initializes the signal set specified by the SET parameter. The
initialized set excludes all signal types.
Comparison to C Function
Functional Differences
None
SIGFILLSET
ALGOL Syntax
SIGFILLSET (SET, ERRNO);
Description
The SIGFILLSET function initializes a signal set (specified by the SET parameter) so that
all signal types are included.
Comparison to C Function
Functional Differences
None
SIGHOLD
ALGOL Syntax
SIGHOLD (SIG, ERRNO);
Description
The SIGHOLD function adds a signal type (specified by the SIG parameter) to the
process's signal mask. The signal mask contains signal types that are blocked for delivery.
Comparison to C Function
Functional Differences
None
SIGIGNORE
ALGOL Syntax
SIGIGNORE (SIG, ERRNO);
Description
The SIGIGNORE function establishes the ignore action for the signal type specified by the
SIG parameter.
Comparison to C Function
Functional Differences
None
SIGISMEMBER
ALGOL Syntax
SIGISMEMBER (SET, SIG, ERRNO);
Description
The SIGISMEMBER function tests whether a signal type (specified by the SIG parameter)
is a member of the signal set specified by the SET parameter.
Comparison to C Function
Functional Differences
None
SIGNAL
ALGOL Syntax
SIGNAL (SIG, ACT_PROC, DISP, ERRNO);
Description
The SIGNAL function defines the action to be taken upon receipt of the signal type
specified by the SIG parameter. The DISP parameter references a signal handling
procedure address or specifies a particular function.
Comparison to C Function
Functional Differences
None
SIGPAUSE
ALGOL Syntax
SIGPAUSE (SIG, ERRNO);
Description
The SIGPAUSE function removes a signal type (specified by the SIG parameter) from the
process’s signal mask and then suspends the process until that signal occurs.
Comparison to C Function
Functional Differences
None
SIGPENDING
ALGOL Syntax
SIGPENDING (SET, ERRNO);
Description
The SIGPENDING function retrieves a set of signal types that are pending for the calling
process. Upon completion, output parameter SET references this signal set.
Comparison to C Function
Functional Differences
None
SIGPROCMASK
ALGOL Syntax
SIGPROCMASK (HOW, SET, OSET, ERRNO);
Description
The SIGPROCMASK function allows the calling process to examine or change its set of
blocked signals (signal mask). This function can do either of the following:
Comparison to C Function
Functional Differences
The ALGOL and C functions require different syntax to retrieve the current signal mask:
SIGPUSH
ALGOL Syntax
SIGPUSH (ERRNO);
Description
The SIGPUSH function creates a new signal environment for the calling process.
Comparison to C Function
Functional Differences
None
SIGRELSE
ALGOL Syntax
SIGRELSE (SIG, ERRNO);
Description
The SIGRELSE function removes a signal type (specified by the SIG parameter) from the
calling process's signal mask. The process can then receive that signal type.
Comparison to C Function
Functional Differences
None
SIGSET
ALGOL Syntax
SIGSET (SIG, ACT_PROC, DISP, ERRNO);
Description
The SIGSET function blocks a signal type or specifies an action for a signal type.
void (*sigset (int sig, void (*func) (int sig))) (int sig);
Comparison to C Function
Functional Differences
None
SIGSUSPEND
ALGOL Syntax
SIGSUSPEND (SIGMASK, ERRNO);
Description
The SIGSUSPEND function replaces the signal mask of the calling process and then
suspends the process. The process will then wait for a signal to awaken it.
Comparison to C Function
Functional Differences
None
SLEEP
ALGOL Syntax
SLEEP (SECS, ERRNO);
Description
The SLEEP function suspends the calling process for the number of real-time seconds
specified by the SECS parameter. A signal may also reactivate the suspended process.
Comparison to C Function
Functional Differences
None
STAT
ALGOL Syntax
STAT (PATH, PATH_OFF, PATH_LEN, PATH_TYPE, PATH_SEARCHRULE, BUF,
BUF_OFF, BUF_MAX, ERRNO);
Description
The STAT function obtains file status for the file specified in the PATH array. This status
is returned to the BUF array.
Comparison to C Function
Functional Differences
None
STRERROR
ALGOL Syntax
STRERROR (BUFF, BUFF_OFF, BUFF_MAX, ERRNO);
Description
The STRERROR function obtains a string of descriptive text associated with the error
value specified in the ERRNO parameter. This string is placed in the BUFF array.
Comparison to C Function
Functional Differences
The ALGOL function receives a different result.
SYSCONF
ALGOL Syntax
SYSCONF (NAME, ERRNO);
Description
The SYSCONF function obtains the current value of the configurable system variable
defined by NAME.
Comparison to C Function
Functional Differences
None
TIMEP
ALGOL Syntax
TIMEP (ERRNO);
Description
The TIMEP function returns a value that represents the current time.
The returned value is the number of seconds that have elapsed since 00:00:00 Greenwich
Mean Time on January 1, 1970.
Comparison to C Function
Functional Differences
The ALGOL function does not support tloc. Only the returned value provides time
information.
TIMES
ALGOL Syntax
TIMES (BUF, BUF_OFF, BUF_MAX, BUF_LEN, ERRNO);
Description
The TIMES function obtains time accounting information (expressed in clock ticks) for
the current process and its child processes.
Comparison to C Function
Functional Differences
BUF_LEN indicates the number of words transferred into the BUF array. The C language
times( ) function does not return this value.
UNAME
ALGOL Syntax
UNAME (NAME, NAME_OFF, NAME_MAX, ERRNO);
Description
The UNAME function obtains information about the system’s current hardware and
software environment.
Comparison to C Function
Functional Differences
None
WAITP
ALGOL Syntax
WAITP (STATUS, ERRNO);
Description
The WAITP function suspends execution of the calling process until one of the following
occurs:
Comparison to C Function
Functional Differences
None
WAITPID
ALGOL Syntax
WAITPID (PID, STATUS, OPTIONS, ERRNO);
Description
The WAITPID function suspends execution of the calling process until a child process
(defined by the PID parameter) returns status. The OPTIONS parameter allows you to
define certain aspects of this function’s operation.
The OPTIONS parameter allows you to modify the operation of this function:
• If you specify the WNOHANG option, the function does not wait if termination status
is not immediately available. Instead, a value of –1 is returned.
• If you specify the WUNTRACED option, the function reports status of stopped or
terminated child processes. By default, only terminated task status is reported.
Comparison to C Function
Functional Differences
None
Table 4-1 lists those POSIX interface based C language functions not currently supported
by the ALGOL include file or through a library procedure. Some of these functions will be
supported in a future release.
Supported . . .
By the
ALGOL Through a
C Language Include Library
Function File? Procedure?
creat( ) No Yes
cuserid( ) No Yes
dup( ) No Yes
dup2( ) No Yes
execl( ) No No
execle( ) No No
execlp( ) No No
execv( ) No No
execvp( ) No No
exit( ) No Yes
Supported . . .
By the
ALGOL Through a
C Language Include Library
Function File? Procedure?
_exit( ) No Yes
fcntl( ) No Yes
fileno( ) No No
fpathconf( ) No Yes
fstat( ) No Yes
getenv( ) No No
lseek( ) No Yes
_MCPfstat( ) No Yes
_MCPstat( ) No Yes
open( ) No Yes
pipe( ) No Yes
putenv( ) No No
read( ) No Yes
rename( ) No Yes
setegid( ) No No
sigaddset( ) Yes No
sigfillset( ) Yes No
siglongjmp( ) No No
tzset( ) No No
umask( ) No Yes
write( ) No Yes
Note: The library procedures described in this section are internal interfaces used by
the system software. These interfaces might also be of use to sophisticated
application programs. From one release to another, an internal interface might
change in such a way that programs that use the internal interface will be
required to make changes to operate correctly. Because internal interfaces are
special system interfaces, they do not adhere to the compatibility policies
described in the SSR 42.3 Software Release Capabilities Overview. You should
examine all programs that use internal interfaces before installing a new
release to ensure that the internal interface has not changed.
• Most functions are referred to by equivalent C language function names (for example,
pipe( ) and stat( ) ). See the C Programming Reference Manual, Volume 2: Headers
and Functions for details about C language functions.
• A few functions (not available in the C language) are listed in uppercase letters (for
example, GETPGID and GETUSERID). See Section 3 for details about these
functions.
Table 5–1 lists currently supported POSIX functions and the library procedure associated
with each function.
Caution
This section contains references to functions that are “not yet supported.” Do not
attempt to use these functions. Unsupported functions return an unpredictable
result; possible results include an ENOSYS error or a logical program fault.
Related Library
Function Procedure Comment
access( ) POSIX_ACCESS
alarm( ) POSIX_NANOALARM
chdir( ) POSIX_CHANGEDIR
chmod( ) POSIX_CHANGEMODE
chown( ) POSIX_CHANGEOWNER
Related Library
Function Procedure Comment
close( ) POSIX_CLOSE
creat( ) POSIX_FILE_TO_FD, POSIX_FILEATTRIBAGENT support is
POSIX_FILEATTRIBAGENT, planned for a future release.
and POSIX_OPEN
cuserid( ) POSIX_STRINGIDS
dup( ) POSIX_FCNTL
dup2( ) POSIX_FCNTL
execve( ) POSIX_EXECVE
exit( ) POSIX_EXIT
_exit( ) POSIX_EXIT
fchmod( ) POSIX_CHANGEMODE
fchown( ) POSIX_CHANGEOWNER
fcntl( ) POSIX_FCNTL
fork( ) POSIX_FORK
fpathconf( ) POSIX_PATHCONF
fstat( ) POSIX_FILESTATUS
getcwd( ) POSIX_STRINGIDS
getegid( ) POSIX_INTEGERIDS
geteuid( ) POSIX_INTEGERIDS
getgid( ) POSIX_INTEGERIDS
getgrgid( ) POSIX_GETGRINFO
getgrnam( ) POSIX_GETGRINFO
getgroups( ) POSIX_GROUPLIST
getlogin( ) POSIX_STRINGIDS
GETPGID POSIX_INTEGERIDS
getpgrp( ) POSIX_INTEGERIDS
getpid( ) POSIX_INTEGERIDS
getppid( ) POSIX_INTEGERIDS
getpwnam( ) POSIX_GETPWINFO
getpwuid( ) POSIX_GETPWINFO
getsgid( ) POSIX_INTEGERIDS
Related Library
Function Procedure Comment
GETSID POSIX_INTEGERIDS
getsuid( ) POSIX_INTEGERIDS
GETUSERID POSIX_STRINGIDS
GETUSERNAME POSIX_STRINGIDS
kill( ) POSIX_SIGHANDLER
lchmod( ) POSIX_CHANGEMODE
lchown( ) POSIX_CHANGEOWNER
lseek( ) POSIX_SEEK
lstat( ) POSIX_FILESTATUS
_MCPfstat( ) POSIX_FILESTATUS
_MCPlstat( ) POSIX_FILESTATUS
_MCPstat( ) POSIX_FILESTATUS
mkfifo( ) MCPX_MKNOD
NICE POSIX_SETIDS
open( ) POSIX_FILE_TO_FD, POSIX_FILEATTRIBAGENT support is
POSIX_FILEATTRIBAGENT, planned for a future release.
and POSIX_OPEN
pathconf( ) POSIX_PATHCONF
pause( ) POSIX_SIGHANDLER
pipe( ) POSIX_PIPE
raise( ) POSIX_SIGHANDLER
read( ) POSIX_SREAD_E or
POSIX_SREAD_R
readlink( ) POSIX_FILESTATUS
semctl( ) MCPX_SEMCTL
semget( ) MCPX_SEMGET
semop( ) MCPX_SEMOP
sem_close( ) POSIX_SEM_CLOSE
sem_destroy( ) POSIX_DESTROY
sem_getvalue( ) POSIX_GETVALUE
sem_init( ) POSIX_SEM_INIT
sem_open( ) POSIX_SEM_OPEN
Related Library
Function Procedure Comment
sem_post( ) POSIX_SEM_POST
sem_trywait( ) POSIX_SEM_TRYWAIT
sem_unlink( ) POSIX_SEM_UNLINK
sem_wait( ) POSIX_SEM_WAIT
setegid( ) POSIX_SETIDS
seteuid( ) POSIX_SETIDS
setgid( ) POSIX_SETIDS
setpgid( ) POSIX_SETIDS
SETPGRP POSIX_SETIDS
setsid( ) POSIX_SETIDS
setuid( ) POSIX_SETIDS
sigaction( ) POSIX_SIGHANDLER
sigaddset( ) – The ALGOL include file contains
required code. No library procedure is
available.
sigdelset( ) – The ALGOL include file contains
required code. No library procedure is
available.
sigemptyset( ) – The ALGOL include file contains
required code. No library procedure is
available.
sigfillset( ) – The ALGOL include file contains
required code. No library procedure is
available.
sighold( ) POSIX_SIGHANDLER
sigignore( ) POSIX_SIGHANDLER
sigismember( ) – The ALGOL include file contains
required code. No library procedure is
available.
signal( ) POSIX_SIGHANDLER
sigpause( ) POSIX_SIGHANDLER
sigpending( ) POSIX_SIGHANDLER
sigprocmask( ) POSIX_SIGHANDLER
sigpush( ) POSIX_SIGHANDLER
Related Library
Function Procedure Comment
sigrelse( ) POSIX_SIGHANDLER
sigset( ) POSIX_SIGHANDLER
sigsuspend( ) POSIX_SIGHANDLER
sleep( ) POSIX_NANOSLEEP
stat( ) POSIX_FILESTATUS
sysconf( ) POSIX_SYSCONF
umask( ) POSIX_SETIDS
uname( ) POSIX_UNAME
wait( ) POSIX_WAITPID
waitpid( ) POSIX_WAITPID
write( ) POSIX_SWRITE_E or
POSIX_SWRITE_R
MCPX_MKNOD
The MCPX_MKNOD procedure creates various types of POSIX special files.
Supported Functions
The File Type value (provided in the MODE parameter) defines the C language function
invoked by the procedure:
mkfifo( ) S_IFIFO
mkdir( ) S_IFDIR – (not yet supported)
symlink( ) S_IFLNK – (not yet supported)
Procedure Declaration
You declare the procedure as follows:
Parameter Summary
4 = VALUE(EBCDIC)
5 = VALUE(ASCII)
DEV_SEARCHRULE Call-by-value integer Not used with currently supported
functions.
ERRNO ERRNO This returned value indicates error status.
See “ERRNO” in Section 2.
<result> Integer result A function-specific result is returned. See
“Result (Integer or Real)” in Section 2.
MCPX_SEMCTL
The MCPX_SEMCTL procedure provides a set of functions for an X/Open-defined
semaphore or semaphore set. Another procedure (MCPX_SEMOP) provides functions for
a flexible subset of semaphores.
Supported Functions
MCPX_SEMCTL provides a function equivalent to the C language semctl( ) function.
Procedure Declaration
You declare this procedure as follows:
Parameter Summary
MCPX_SEMGET
The MCPX_SEMGET procedure creates a new set of X/Open-defined semaphores or
connects to an existing set of semaphores.
Supported Functions
MCPX_SEMGET provides a function equivalent to the C language semget( ) function.
Procedure Declaration
You declare this procedure as follows:
Parameter Summary
0 IPC_PRIVATE
NSEMS Call-by-value integer This input parameter defines the number
of semaphores in a set.
SEMFLG Call-by-value integer This input parameter specifies semaphore
flags and access permission bits.
MCPX_SEMOP
The MCPX_SEMOP procedure performs user-defined operations on a specified group of
X/Open-defined semaphores.
Supported Functions
MCPX_SEMOP provides a function equivalent to the C language semop( ) function.
Procedure Declaration
You declare the procedure as follows:
Parameter Summary
POSIX_ACCESS
The POSIX_ACCESS procedure determines if specified access permissions are available
for a particular file or directory.
Supported Functions
POSIX_ACCESS provides a function equivalent to the C language access( ) function.
Procedure Declaration
You declare the procedure as follows:
Parameter Summary
POSIX_ALLOCATE_FD
The POSIX_ALLOCATE_FD procedure performs the initial phase of a POSIX.1 open( ) or
creat( ) function. The POSIX_ALLOCATE_FD procedure:
• Initializes the FD_VECTOR array of the calling process (only required for the first file
descriptor request).
• Searches the FD_VECTOR array for lowest available file descriptor. It resizes the
array if necessary.
• Searches SYSTEM_FILE_VECTOR stack for an available entry. It resizes the stack if
necessary.
• Creates a new file information block (FIB) and places the mom descriptor into the
SYSTEM_FILE_VECTOR stack.
• Associates the newly allocated file descriptor with the newly allocated file located in
the SYSTEM_FILE_VECTOR STACK.
• Returns the lowest available file descriptor value to the calling process.
Supported Functions
POSIX_ALLOCATE_FD is one of three library procedures necessary to perform an
operation equivalent to the C language open( ) or creat( ) function. These procedures are:
• POSIX_ALLOCATE_FD
• POSIX_FILEATTRIBAGENT
• POSIX_OPEN
Procedure Declaration
You declare the procedure as follows:
Parameter Summary
POSIX_CHANGEDIR
The POSIX_CHANGEDIR procedure changes the current working directory of the calling
process. The CURRENTDIRECTORY task attribute stores this value.
Supported Functions
POSIX_CHANGEDIR provides a function equivalent to the C language chdir( ) function.
Procedure Declaration
You declare the procedure as follows:
Parameter Summary
POSIX_CHANGEMODE
The POSIX_CHANGEMODE procedure alters the SECURITYMODE file attribute for a
specified disk file. This attribute is an encoded value that provides:
Supported Functions
The SELECTOR parameter defines the C function invoked by this procedure.
Procedure Declaration
You declare the procedure as follows:
Parameter Summary
POSIX_CHANGEOWNER
The POSIX_CHANGEOWNER procedure changes the OWNER and/or GROUP attribute of
a disk file. The calling process must have appropriate permissions or the effective user ID
must match the existing owner of the file.
Supported Functions
The SELECTOR parameter defines the C function invoked by this procedure.
Procedure Declaration
You declare the procedure as follows:
Parameter Summary
POSIX_CLOSE
The POSIX_CLOSE procedure closes a specified file descriptor. The
POSIX_ALLOCATE_FD or POSIX_FILE_TO_FD procedures allocate these file descriptors.
Supported Functions
POSIX_CLOSE provides a function equivalent to the C language close( ) function.
Procedure Declaration
You declare the procedure as follows:
Parameter Summary
POSIX_EXECVE
The POSIX_EXECVE procedure executes a specified code file. There is no return from a
successful operation—the new process image overlays the previous process image.
Supported Functions
POSIX_EXECVE provides a function equivalent to the C language execve( ) function;
there is no support for other exec( ) family functions.
Procedure Declaration
You declare the procedure as follows:
Parameter Summary
POSIX_EXIT
The POSIX_EXIT procedure terminates the calling process. It then stores exit status in
the EXIT_STATUS TAB word and passes control back to the system. POSIX_EXIT never
returns a result or sets an ERRNO value.
Supported Functions
The SELECTOR parameter defines the C function invoked by this procedure.
Procedure Declaration
You declare the procedure as follows:
Parameter Summary
POSIX_FCNTL
The POSIX_FCNTL procedure can perform a variety of control functions on a specified
open file.
Supported Functions
POSIX_FCNTL provides functions equivalent to the C language fcntl( ) function as well as
two derivative functions, dup( ) and dup2( ).
Procedure Declaration
You declare the procedure as follows:
Parameter Summary
POSIX_FILESTATUS
The POSIX_FILESTATUS procedure obtains file status information for a specified file.
The file can be specified by filename or by file descriptor.
Supported Functions
The SELECTOR parameter defines the C function invoked by this procedure.
Procedure Declaration
You declare the procedure as follows:
Parameter Summary
POSIX_FILE_TO_FD
The POSIX_FILE_TO_FD procedure allocates a new file descriptor and attaches it to a
specified existing file. This procedure cannot process direct files.
• Initializes the FD_VECTOR array of the calling process (only required on the first file
descriptor request).
• Searches the FD_VECTOR array for lowest available file descriptor. It resizes the
array if necessary.
• Associates newly allocated file descriptor with the file specified in the FYLE
parameter.
• Initializes the specified file and applies all file attributes provided in the FILE
declaration.
• Sets the FD_CLOEXEC flag for the file descriptor.
Supported Functions
There is no equivalent C language function.
Procedure Declaration
You declare the procedure as follows:
Parameter Summary
POSIX_FORK
The POSIX_FORK procedure creates a new process. This new process is known as a child
process.
Supported Functions
The SELECTOR parameter defines the C function invoked by this procedure:
Procedure Declaration
You declare the procedure as follows:
Parameter Summary
POSIX_GETGRINFO
The POSIX_GETGRINFO procedure obtains the GROUP structure associated with a
specified group ID or group name.
Supported Functions
The SELECTOR parameter defines the C function invoked by this procedure:
Parameter Summary
POSIX_GETPWINFO
The POSIX_GETPWINFO procedure returns the PASSWD structure for a specified user ID
or user name. This structure does not include the actual password.
Supported Functions
The SELECTOR parameter defines the C function invoked by this procedure:
Procedure Declaration
You declare the procedure as follows:
Parameter Summary
POSIX_GROUPLIST
The POSIX_GROUPLIST procedure obtains all supplementary group IDs associated with
the calling process.
Supported Functions
The SELECTOR parameter defines the C function invoked by this procedure.
Procedure Declaration
You declare the procedure as follows:
Parameter Summary
POSIX_INTEGERIDS
The POSIX_INTEGERIDS procedure obtains various ID values associated with the calling
process.
Supported Functions
The SELECTOR parameter defines the functions supported by this procedure. Note that
SELECTOR values 8 and 13 provide a pair of special functions:
Parameter Summary
POSIX_NANOALARM
The POSIX_NANOALARM procedure causes the system to send a signal (type SIGALRM)
to the calling process following a specified period of time. This procedure can also cancel
a pending request of this type.
Supported Functions
POSIX_NANOALARM provides a function equivalent to the C language alarm( ) function.
Procedure Declaration
You declare the procedure as follows:
Parameter Summary
POSIX_NANOSLEEP
The POSIX_NANOSLEEP procedure suspends the calling process for a specified amount
of time. A signal may reactivate the suspended process.
Supported Functions
POSIX_NANOSLEEP provides a function equivalent to the C language sleep( ) function.
Procedure Declaration
You declare the procedure as follows:
Parameter Summary
POSIX_OPEN
The POSIX_OPEN procedure opens a file (referenced by file descriptor) with specified
truncate and open type options.
This procedure supports the final phase of a POSIX.1 open( ) or creat( ) function. The
following procedures must precede POSIX_OPEN:
Procedure Declaration
You declare the procedure as follows:
Parameter Summary
POSIX_PATHCONF
The POSIX_PATHCONF procedure obtains configuration variable information about a
specified open file or path. The path can be specified directly or by file descriptor.
Supported Functions
The SELECTOR parameter defines the C function invoked by this procedure.
Procedure Declaration
You declare the procedure as follows:
Parameter Summary
POSIX_PIPE
The POSIX_PIPE procedure creates a half-duplex interprocess channel known as a pipe.
Two file descriptors (one read-only and the other write-only) are passed back to the
program.
Supported Functions
POSIX_PIPE provides a function equivalent to the C language pipe( ) function.
Procedure Declaration
You declare the procedure as follows:
Parameter Summary
POSIX_SEEK
The POSIX_SEEK procedure repositions the current record pointer in an open file
description.
Supported Functions
POSIX_SEEK provides a function equivalent to the lseek( ) or seekdir( ) C language
functions. The seekdir( ) function is not yet supported.
Procedure Declaration
You declare the procedure as follows:
Parameter Summary
POSIX_SEM_CLOSE
The POSIX_SEM_CLOSE procedure closes a named semaphore that is currently open.
When a process closes a semaphore, that process no longer has access to it. However,
closing a named semaphore does not remove it from the system.
Supported Functions
POSIX_SEM_CLOSE provides a function equivalent to the C language sem_close( )
function.
Procedure Declaration
You declare the procedure as follows:
Parameter Summary
POSIX_SEM_DESTROY
The POSIX_SEM_DESTROY procedure destroys an unnamed semaphore. Destroying a
semaphore removes it from the system.
Supported Functions
POSIX_SEM_DESTROY provides a function equivalent to the C language sem_destroy( )
function.
Procedure Declaration
You declare the procedure as follows:
Parameter Summary
POSIX_SEM_GETVALUE
The POSIX_SEM_GETVALUE procedure retrieves the value of a specified named or
unnamed semaphore.
The retrieved value reflects an actual value of the semaphore at some time during the call.
This may not be the actual value of the semaphore at the time the procedure returns.
Supported Functions
POSIX_SEM_GETVALUE provides a function equivalent to the C language
sem_getvalue( ) function.
Procedure Declaration
You declare the procedure as follows:
Parameter Summary
POSIX_SEM_INIT
The POSIX_SEM_INIT procedure creates an unnamed semaphore.
Supported Functions
POSIX_SEM_INIT provides a function equivalent to the C language sem_init( ) function.
Procedure Declaration
You declare the procedure as follows:
Parameter Summary
POSIX_SEM_OPEN
The POSIX_SEM_OPEN procedure opens a named semaphore. The procedure can either:
Supported Functions
POSIX_SEM_OPEN provides a function equivalent to the C language sem_open( )
function.
Procedure Declaration
You declare the procedure as follows:
Parameter Summary
NAME, EBCDIC array input The array contains the name of the
NAME_OFF, semaphore. This name must conform to
NAME_LEN POSIX pathname naming rules.
OFLAG Call-by-value integer This input parameter specifies whether the
procedure is to open an existing
semaphore or create a new semaphore.
There are two flag bits:
[15:01] O_CREAT
[17:01] O_EXCL
MODE Call-by-value integer This input parameter contains permission
bits for the new semaphore. It is valid only
when OFLAG specifies the O_CREAT flag
bit.
See “MODE parameter” in Section 2 for a
description of bit assignments.
VAL Call-by-value integer This input parameter contains the initial
value of a new semaphore. It is valid only
when OFLAG specifies the O_CREAT flag
bit.
ERRNO ERRNO This returned value indicates error status.
See “ERRNO” in Section 2.
<result> Integer result A function-specific result is returned. See
“Result (Integer or Real)” in Section 2.
POSIX_SEM_POST
The POSIX_SEM_POST procedure adds one to the value of a named or unnamed
semaphore. A semaphore is unlocked when it has a value greater than 0.
Supported Functions
POSIX_SEM_POST provides a function equivalent to the C language sem_post( ) function.
Procedure Declaration
You declare the procedure as follows:
Parameter Summary
POSIX_SEM_TRYWAIT
The POSIX_SEM_TRYWAIT operates on named or unnamed semaphores as follows:
If the semaphore
value is . . . Then POSIX_SEM_TRYWAIT . . .
Supported Functions
POSIX_SEM_TRYWAIT provides a function equivalent to the C language sem_trywait( )
function.
Procedure Declaration
You declare the procedure as follows:
Parameter Summary
POSIX_SEM_UNLINK
The POSIX_SEM_UNLINK procedure deletes the name of a semaphore from the system
table.
Supported Functions
POSIX_SEM_UNLINK provides a function equivalent to the C language sem_unlink( )
function.
Procedure Declaration
You declare the procedure as follows:
Parameter Summary
NAME, EBCDIC array input The array contains the name of the
NAME_OFF, applicable semaphore. This name must
NAME_LEN conform to POSIX pathname naming rules.
ERRNO ERRNO This returned value indicates error status.
See “ERRNO” in Section 2.
<result> Integer result A function-specific result is returned. See
“Result (Integer or Real)” in Section 2.
POSIX_SEM_WAIT
The POSIX_SEM_WAIT procedure decrements the value of an unlocked named or
unnamed semaphore. If the semaphore is already locked (that is, has a value of 0), the
procedure waits until it is unlocked by another process.
Supported Functions
POSIX_SEM_WAIT provides a function equivalent to the C language sem_wait( ) function.
Procedure Declaration
You declare the procedure as follows:
Parameter Summary
POSIX_SETIDS
The POSIX_SETIDS procedure changes either:
Procedure Declaration
You declare this procedure as follows:
Parameter Summary
POSIX_SIGHANDLER
The POSIX_SIGHANDLER procedure provides a number of functions associated with
signals.
Supported Functions
The SELECTOR parameter defines the C function invoked by this procedure.
Procedure Declaration
You declare this procedure as follows:
Parameter Summary
sigaction( ) SELECTOR
SIG
ACT_PROC
ACT, ACT_OFF, ACT_LEN
OACT, OACT_OFF, OACT_LEN
ERRNO
sigset( ), SELECTOR
signal( )
SIG
ACT_PROC
VAR1 - Serves as the equivalent of the disp argument. See
“DISP parameter” in Section 2 for additional
information.
ERRNO
sighold( ), SELECTOR
sigrelse( ),
SIG
sigignore( ),
raise( ), ERRNO
sigpause( )
sigprocmask( ) SELECTOR
VAR1- Serves as the equivalent of the how argument: See
“HOW parameter” in Section 2 for additional
information.
VAR2 - Serves as the equivalent of the set argument.
Identifies the set of signal types to be added to,
removed from, or used as, the process’s signal mask
(blocked signals).
OVAR1 - Serves as the equivalent of the oset argument.
Identifies the current process’s signal mask (blocked
signals).
ERRNO
sigpending( ) SELECTOR
OVAR1 - Serves as the equivalent of the set argument.
Identifies the set of pending signals.
ERRNO
pause( ), SELECTOR
sigpush( ) macro
ERRNO
sigsuspend( ) SELECTOR
VAR1 - Serves as the equivalent of the sigmask argument.
Identifies the local set of signal types.
ERRNO
kill( ) SELECTOR
SIG
VAR1 - Serves as the equivalent of the pid argument
(indicates receiving process or processes. See “PID
parameter (KILL)” in Section 2 for additional
information.
ERRNO
POSIX_SREAD_x
Two procedures are available to read data from a file associated with a specified file
descriptor.
Functions Supported:
The POSIX_SREAD_x procedures provide a function equivalent to the C language read( )
function.
Parameter Summary
POSIX_STRINGIDS
The POSIX_STRINGIDS procedure retrieves information associated with the calling
process or a specified file descriptor.
Supported Functions
The SELECTOR parameter defines the seven functions supported by this procedure.
Procedure Declaration
You declare this procedure as follows:
Parameter Summary
POSIX_SWRITE_x
Two procedures are available to write data to the file associated with a specified file
descriptor.
Functions Supported:
The POSIX_SWRITE_x procedures provide a function equivalent to the C language
write( ) function.
Parameter Summary
POSIX_SYSCONF
The POSIX_SYSCONF procedure determines the current value of a specified configurable
system variable.
Supported Functions
POSIX_SYSCONF provides a function equivalent to the C language sysconf( ) function.
Procedure Declaration
You declare this procedure as follows:
Parameter Summary
POSIX_TIME
The POSIX_TIME procedure obtains a value (number of seconds since 00:00:00 Greenwich
Mean Time on January 1, 1970) that represents the current time. This value is returned as
an integer result.
Supported Functions
POSIX_TIME provides a function equivalent to the C language time( ) function.
Procedure Declaration
You declare this procedure as follows:
Parameter Summary
POSIX_TIMES
The POSIX_TIMES procedure returns time accounting information for the current process
and its child processes.
Supported Functions
POSIX_TIMES provides a function equivalent to the C language times( ) function.
Procedure Declaration
You declare this procedure as follows:
Parameter Summary
POSIX_UNAME
The POSIX_UNAME procedure returns hardware and software information about the host
system processing environment.
Supported Functions
POSIX_UNAME provides a function equivalent to the C language uname( ) function.
Procedure Declaration
You declare this procedure as follows:
Parameter Summary
POSIX_WAITPID
The POSIX_WAITPID procedure suspends the execution of the calling process until a
specified child process returns status information.
Supported Functions
POSIX_WAITPID provides functions equivalent to the C language wait( ) and waitpid( )
functions. The following conditions force a function equivalent to wait( ):
• PID parameter = -1
• OPTION parameter = 0
Procedure Declaration
You declare this procedure as follows:
Parameter Summary
Example 1 illustrates a simple ALGOL program that uses many of the functions described
in Section 3. Note that this program includes the SYMBOL/POSIX/ALGOL/PROPERTIES
file. Briefly, this program:
BEGIN
$INCLUDE "SYMBOL/POSIX/ALGOL/PROPERTIES."
DEFINE
SEND_MSG (L, P) = BEGIN
REPLACE POINTER (P) + L BY 0 FOR 1;
IF MYSELF.SW1
THEN
DISPLAY (P)
ELSE
WRITE (RMT, L, P);
END #,
MSG_INIT = MSGP := POINTER (MSG) #,
PTXT (X) = REPLACE MSGP:MSGP BY X #,
PNUM (X) = BEGIN
IF (X) < 0 THEN PTXT ("-");
PTXT ((X) FOR * DIGITS);
END #,
PSTR (X) = PTXT ((X) UNTIL = 0) #,
PERR (N) = BEGIN
REPLACE EMSG BY 0 FOR 100;
STRERROR(EMSG,0,100,N);
PTXT("@LINE "); PTXT(LINENUMBER FOR 8 DIGITS);
PTXT(" ERROR= "); PNUM(N);
PTXT(" "); PSTR(EMSG);
FLUSH;
N := 0;
END #,
FLUSH = BEGIN
SEND_MSG (OFFSET (MSGP), MSG);
MSGP := POINTER (MSG);
END #;
LABEL XIT;
EBCDIC ARRAY STR[0:99];
REAL ARRAY SOPS[0:2], ARG[0:SEMID_DS_SIZE-1];
PNUM(GROUPID);PTXT("(");
IF GETGRGID(GROUPID, GR, 0, 100, ERR) < 0 THEN
BEGIN
PTXT("?????)");FLUSH;
STRERROR(STR, 0, 100, ERR);
PTXT("GETGRGID ERROR: ");PSTR(STR);FLUSH;
END
ELSE
BEGIN
PSTR(POINTER(GR[GR_NAME]));PTXT(")");FLUSH;
END;
END OF PRINTGROUP;
PNUM(USERID);PTXT("(");
IF GETPWUID(USERID, PW, 0, PW_SIZE, ERR) < 0 THEN
BEGIN
PTXT("?????)");FLUSH;
STRERROR(STR, 0, 100, ERR);
PTXT("GETPWUID ERROR: ");PSTR(STR);FLUSH;
END
ELSE
BEGIN
PSTR(POINTER(PW[PW_NAME]));PTXT(")");FLUSH;
END;
END OF PRINTUSER;
XIT:
END OF PRINTALLGROUPS;
PRINTUSER(GETUID(ERR));
PRINTUSER(GETEUID(ERR));
PRINTGROUP(GETGID(ERR));
PRINTGROUP(GETEGID(ERR));
PRINTALLGROUPS;
END OF PERSONAL_INFO;
END OF PARENT_INFO;
END OF CHILD_INFO;
XIT:
END OF DIRSETUP;
PAUSE(ERR);
PTXT("DONE WITH PAUSE");FLUSH;
FLAG := 1;
IF ALARM(10, ERR) < 0 THEN
BEGIN
STRERROR(STR, 0, 100, ERR);
PTXT("ALARM ERROR: ");PSTR(STR);FLUSH;
GO XIT;
END;
SLEEP(100, ERR);
PTXT("DONE WITH SLEEP");FLUSH;
XIT:
END OF SIGSETUP;
END OF SEM_OPERATION;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% START OF THE TEST PROGRAM % % Main program
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
MSG_INIT;
FLUSH;
I := LINKLIBRARY(MCPSUPPORT);
PTXT("RESULT OF LINKLIBRARY IS ");PNUM(I);
FLUSH;
% CREATE A SEMAPHORE
SEMID := SEMGET(1000, 2, 1"111111111" & 1 IPC_CREAT, ERR);
IF SEMID < 0 THEN
BEGIN
STRERROR(STR, 0, 100, ERR);
PTXT("SEMGET ERROR: ");PSTR(STR);FLUSH;
GO XIT;
END;
ARG[0] := ARG[1] := 1;
SEMCTL(SEMID, 2, SEM_SETALL, 0, ARG, 0, SEMID_DS_SIZE, ERR);
VAR := 88;
SETSID(ERR); % ESTABLISH THE CALLING PROCESS AS SESSION AND
% PROCESS GROUP LEADER
PID := FORK(ERR);
IF PID < 0 THEN
BEGIN
STRERROR(STR, 0, 100, ERR);
PTXT("FORK ERROR: ");PSTR(STR);FLUSH;
GO XIT;
END
ELSE IF PID = 0 THEN % CHILD PROCESS
BEGIN
GET_CONTROL; % GET CONTROL
CHILD_INFO; % PRINT CHILD INFORMATION
REL_CONTROL; % RELEASE CONTROL
GLOB := GLOB + 1;
VAR := VAR + 1;
PTXT("CHILD PID=");PNUM(GETPID(ERR));PTXT(" GLOB=");PNUM(GLOB);
PTXT(" VAR=");PNUM(VAR);FLUSH;
GO XIT;
END;
% PARENT PROCESS
GET_CONTROL; % OBTAIN CONTROL
PARENT_INFO; % PRINT USER RELATED INFORMATION
REL_CONTROL; % RELEASE CONTROL
WAITP(STATUS, ERR);
XIT:
END.
#include <sys/types.h>
#include <unistd.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <stdio.h>
#include <signal.h>
#include <limits.h>
#include <grp.h>
#include <pwd.h>
#define TRUE 1
#define FALSE 0
void sigsetup();
void parent_info();
void child_info();
void ding(int);
void sem_operation();
void personal_info();
void printallgroups();
void printuser(uid_t);
void printgroup(gid_t);
void dirsetup();
int glob = 6;
short semary[2];
int flag, semid;
struct sembuf psembuf;
(void)alarm(10);
sleep(100);
(void)printf("Done with sleep\n");
/* create a semaphore */
semid = semget(1000, 2, 0777|IPC_CREAT);
if(semid < 0) {
perror("semget failed");
exit(-1);
}
semary[0]=semary[1]=1;
semctl(semid, 2, SETALL, semary);
var=88;
setsid(); /* establish the calling process as session and
process group leader */
if((pid=fork()) < 0) {
perror("fork error");
exit(-1);
}
else if(pid == 0) { /* child */
get_control; /* wait for control */
child_info();
rel_control; /* release control */
glob++;
var++;
printf("Child pid = %d, glob = %d, var = %d\n",
getpid(), glob, var);
printf("end of child\n");
exit(0);
}
/* parent */
get_control; /* got control? */
parent_info(); /* print user related information */
/* wake up child process */
rel_control; /* release control */
printf("Parent pid = %d, glob = %d, var = %d\n",
getpid(), glob, var);
printf("end of parent\n");
wait(&status);
exit(0);
}
void dirsetup()
{
char buf[PATH_MAX];
char newdir[] = "tempdir";
if(getcwd(buf,PATH_MAX) == NULL) {
perror("getcwd failed");
exit(-1);
}
printf("Old Working Directory is %s\n",buf);
if(chdir(newdir) < 0) {
perror("chdir failed");
exit(-1);
}
if(getcwd(buf,PATH_MAX) == NULL) {
perror("getcwd failed");
exit(-1);
}
printf("Current Working Directory is %s\n",buf);
if(access(newfile, R_OK|W_OK|X_OK) < 0) {
if(chmod(newfile,0777) < 0) {
perror("chmod failed");
exit(-1);
}
}
}
void parent_info()
{
printf("<<<< PARENT PROCESS >>>>\n");
printf("real user id for parent = %d\n", getuid());
printf("real group id for parent = %d\n", getgid());
printf("effective id for parent = %d\n", geteuid());
printf("effective group id for parent = %d\n", getegid());
printf("process group id for parent = %d\n", getpgrp());
personal_info();
}
void child_info()
{
printf("<<<< CHILD PROCESS >>>>\n");
printf("real user id for child = %d\n", getuid());
printf("real group id for child = %d\n", getgid());
printf("effective id for child = %d\n", geteuid());
printf("effective group id for child = %d\n", getegid());
printf("process group id for child = %d\n", getpgrp());
personal_info();
}
void sigsetup()
{
int i;
struct sigaction act,oact;
grpptr = getgrgid(groupid);
if(grpptr == NULL)
{
(void)printf("?????)");
return;
}
(void)printf("%s)",grpptr->gr_name);
return;
}
void printallgroups()
{
int ngroups;
gid_t *grpptr;
int i;
gid_t gid;
#ifndef NGROUPS_MAX
#define NGROUPS_MAX 0
#endif
(void)perror("getgroups() failed");
return;
}
if(ngroups == 0)
{
(void)printf("No supplementary groups are "
"available\n");
return;
}
grpptr = calloc(ngroups,sizeof(gid_t));
if(getgroups(ngroups,grpptr) == -1)
{
(void)perror("getgroups() failed");
return;
}
(void)printf("The following supplementary groups are "
"available\n");
for(i=1; i <= ngroups; i++)
{
gid = *grpptr++;
(void)printf("\t");
printgroup(gid);
(void)printf("\n");
}
#endif
return;
}
void personal_info()
{
uid_t uid;
gid_t gid;
char *login;
login = getlogin();
if(login == NULL)
(void)printf("Login name is not known\n");
else
(void)printf("Login name is '%s'\n",login);
printuser(getuid());
printuser(geteuid());
printgroup(getgid());
printgroup(getegid());
(void)printf("\n");
printallgroups();
}
A
absolute pathname
In the POSIX interface, a pathname that begins with a slash character ( / ). The absolute
pathname locates a file or a directory starting at the file system root.
array
An ordered collection of a fixed number of common elements under one name, each
element having the same data type. Access for each element is through an index to the
common name.
B
blocked signal
A type of signal that the operating system is not delivering to a receiving process as a
result of a request by that receiving process. The operating system indefinitely postpones
delivery of blocked signals; they remain pending until the process conditions change.
by reference
Pertaining to one method of passing a parameter to a procedure. The system evaluates the
location of the actual parameter and replaces the formal parameter with a reference to
that location. Any change made to the formal parameter affects the actual parameter, and
vice versa. Synonym for call-by-reference.
by value
Pertaining to one method of passing a parameter to a procedure. A copy of the value of the
actual parameter is assigned to the formal parameter, which is thereafter handled as a
variable that is local to the procedure body. Any change made to the value of a by-value
formal parameter has no effect outside the procedure body. Synonym for call-by-value.
byte-file
The type of disk file normally created and accessed by a strictly conforming POSIX.1
application. Many traditional system applications do not process byte-files. The following
file attributes define a byte-file: FILESTRUCTURE=STREAM, FRAMESIZE=8, and
MAXRECSIZE=1. See also record-file.
C
call-by-reference
Pertaining to one method of passing a parameter to a procedure. The system evaluates the
location of the actual parameter and replaces the formal parameter with a reference to
that location. Any change made to the formal parameter affects the actual parameter, and
vice versa. Synonym for by reference.
call-by-value
Pertaining to one method of passing a parameter to a procedure. A copy of the value of the
actual parameter is assigned to the formal parameter, which is thereafter handled as a
variable that is local to the procedure body. Any change made to the value of a call-by-
value formal parameter has no effect outside the procedure body. Synonym for by value.
catch a signal
To call a signal-catching function by a process after it is interrupted by delivery of a
specific signal type. See also signal catcher.
child process
In the POSIX interface, a process created with the fork function. It starts as a copy of the
calling (parent) process, but it has its own unique process ID.
D
dot
In the POSIX interface, a filename node that consists solely of a single dot character ( . ).
When part of a pathname, such a node refers to the preceding pathname component.
dot-dot
In the POSIX interface, a filename node that consists of two dot characters ( .. ). When
part of a pathname, such a node refers to the parent of the preceding pathname
component.
D1 stack
See code segment dictionary.
E
EBCDIC
Extended Binary Coded Decimal Interchange Code. An 8-bit code representing 256 graphic
and control characters that are the native character set of most mainframe systems.
EBCDIC array
In ALGOL, an array whose elements are EBCDIC characters.
effective group ID
In the POSIX interface, the group ID currently in effect for a process. The effective group
ID is used to validate file access, establish ownership, and check permissions. This value
is subject to change over the lifetime of the process. It is a numeric value that
corresponds to the GROUPCODE task attribute. See also group ID, real group ID,
GROUPCODE.
effective user ID
In the POSIX interface, the user ID currently in effect for a process. The effective user ID
is used to validate file access, establish ownership, and check permissions. This value is
subject to change over the lifetime of the process. It is a numeric value that corresponds
to the USERCODE task attribute. See also user ID, real user ID, USERCODE.
entry point
A procedure or function that is a library object.
environment
(1) In the Editor, the set of conditions in the area of the object code in which a particular
line of a program is found. This information is stored in the cross-reference files. (2) In the
POSIX interface, an array of string variables of the form "name=value" that specify various
operating characteristics of a process. Individual environment values can be set and
accessed by a program. In addition, a new environment can be established when a
program is executed.
environment variables
(1) In a workstation environment, such as OS/2 , names that specify global values. LIB and
INCLUDE are examples of environment variables. (2) In the POSIX interface, any string
variable contained in the environment.
ERRNO
In the POSIX interface, an external variable for returning error identification information
to the program.
F
family name
(1) The name, consisting of up to 17 alphanumeric characters, assigned by an installation
to identify a family of disks. (2) The name (label) of the disk or disk pack on which a
physical file is located. The family name of a file is determined by the value of the
FAMILYNAME file attribute. (3) The name of the logical group of disk packs on which a
physical file is located. A family name consists of from 1 to 17 alphanumeric characters
and is assigned by the installation.
FIB
See file information block.
file description
See open file description.
file descriptor
In the POSIX interface, a per-process unique, non-negative integer used to identify an open
file for the purpose of file access.
file mode
In the POSIX interface, a word containing file permission bits and other characteristics of
a file. File mode is specified in the SECURITYMODE file attribute.
file name
(1) A name or word that designates a set of data items. (2) A unique identifier for a file,
consisting of name constants separated by slashes. Each name constant consists of letters,
digits, and selected special characters. A file name can be optionally preceded by an
asterisk (*) or usercode, and optionally followed by ON and a family name. (3) In RPG, a
name that designates a set of data items. (4) In COBOL, a user-defined word that names a
file described in a file description entry or a sort-merge file description entry within the
FILE SECTION of the DATA DIVISION. (5) In the POSIX interface, a name node within a
pathname.
file offset
In the POSIX interface, the byte position in the file where the next I/O operation begins.
file title
The complete identifier for a file that consists of the file name, and, for disk files, the word
ON, and the family name.
G
generate a signal
To recognize a signal event and create an appropriate signal.
GID
See group ID.
group
(1) A collection of devices, such as processors, memory modules, and I/O devices, under
the control of a single master control program (MCP). A group is referred to as a partition.
(2) A collection of related data items that can be viewed as a single data item. A group can
also refer to a collection of groups. (3) In the POSIX interface, an association of users who
share a specific group ID as the identifier associated with their GROUPCODE or one of
their SUPPLEMENTARYGRPs.
group class
See file group class.
group ID (GID)
In the POSIX interface, a unique number corresponding to the GROUPCODE task
attribute. The operating system associates the group ID value with an instance of a user
group. A value of 1 indicates that no group is assigned. See also, group, effective group
ID, real group ID.
guard file
A disk file created by the GUARDFILE utility program that describes the access rights of
various users and programs to a program, data file, or database.
I
I/O
Input/output. An operation in which the system reads data from or writes data to a file on
a peripheral device such as a disk drive.
include file
An external file that is included as part of a compilation by writing the INCLUDE
preprocessor directive as part of the source text.
integer
(1) A whole number. (2) In COBOL, a numeric literal or a numeric data item that does not
include any character positions to the right of the assumed decimal point.
intrinsic
A system-supplied program routine for common mathematical and other operations that is
loaded onto the system separately. An intrinsic can be invoked by the operating system or
user programs.
L
library
(1) A collection of objects grouped together to be exported to another process, imported
from another process, or both. There are three types of libraries: client libraries, server
libraries, and connection libraries. (2) Synonym for server library.(3) (VDP) A collection
of related files.
library directory
A library template associated with a server library.
library object
An object that is exported by a server library or connection library and imported by a
client library or connection library.
library process
An instance of the execution of a server library program or connection library program.
M
master control program (MCP)
The central program of the enterprise server operating system.
MCP
See master control program.
mix
The set of processes that currently exist on a particular computer. The mix can include
active, scheduled, and suspended processes.
mix number
A 4-digit number that identifies a process while it is executing. This number is stored in
the MIXNUMBER task attribute.
N
named semaphore
In the POSIX interface, a semaphore that a process references by name (character string).
Note that only POSIX.4-defined semaphores can be referenced in this way; X/Open-defined
semaphores must be referenced by identifier. See semaphore, unnamed semaphore.
null character
A character whose binary value is zero.
null string
An empty or zero-length string.
O
open file
In the POSIX interface, a file that is currently associated with a file descriptor.
other class
See file other class.
owner class
Synonym for file owner class.
owner of a file
A file owner is normally the creator of that file. Typically, the owner has certain privileges
(such as deletion rights) that are not available to other users. The usercode portion of the
file title indicates the owner of most A Series files.
P
parent process
In the POSIX interface, the process that created a child process with the fork function.
See also parent process ID.
path
(1) The route that must be traced from a directory to a subdirectory, or through a series of
subdirectories, to find a file. (2) In the I/O subsystem, a set of addresses that uniquely
describes the data flow between the host and any peripheral device. (3) In Network
Definition Language II (NDLII) and X.25, a route between two nodes. (4) In Data
Management System II (DMSII), a specific location within the logical ordering of a data
set, set, subset, or access. (5) In Extended Retrieval with Graphic Output (ERGO), an
ordered list of data sets used in generating a report. (6) In the MS-DOS operating system, a
specification of all the directories that must be searched to find a file.
pathname
In the POSIX interface, the ordered list of directory filenames that locates a directory or a
file. A slash ( / ) is used to separate each filename from its predecessor. POSIX
pathnames are case-sensitive; therefore, /home/adam is not the same as /home/ADAM.
PCW
See program control word.
pending signal
In the POSIX interface, a signal that has been generated but not yet delivered. See blocked
signal.
PGID
See process group ID.
PIB
See program information block, process information block.
PID
See process ID.
pipe
(1) A connection between two processes through which the output of the first process
becomes the input to the second process. (2) In the POSIX interface, a logical connection
between processes that have a common ancestor. Pipes are half-duplex—data flows in
one direction only. They are accessed by a pair of file descriptors created by the pipe( )
function. Pipes do not have a name in the POSIX file hierarchy. See also FIFO special file.
POSIX
See Portable Operating System Interface.
POSIX.1
An abbreviation for the Portable Operating System Interface (POSIX) – Part 1: System
Application Program Interface (API) [C Language] standard (ISBN 1-55937-061-0). This
standard is published by the Institute of Electrical and Electronics Engineers, Inc. (IEEE).
It defines a portable interface between C language application programs and the operating
system.
POSIX.2
An abbreviation for the Portable Operating System Interface (POSIX) – Part 2: Shell and
Utilities standard (ISBN 1-55937-255-9). This standard is published by the Institute of
Electrical and Electronics Engineers, Inc. (IEEE). It defines a shell command language
and a set of system utilities that are largely based on the system services defined In the
POSIX interface.1.
POSIX.4
An abbreviation for the Part 1: System Application Program Interface (API) –
Amendment 1: Real-time Extension [C Language] of the POSIX family of standards.
This amendment defines optional facilities such as semaphores, messages, and shared
memory.
PPID
See parent process ID.
process
(1) The execution of a program or of a procedure that was initiated. The process has its
own process stack and process information block (PIB). It also has a code segment
dictionary, which can be shared with other processes that are executions of the same
program or procedure. (2) A software application; that is, any activity or systematic
sequence of operations that produces a specified result. (3) In the Advanced Data
Dictionary System (ADDS), a structure that models a logical view of relationships between
different parts of a system.
process group
In the POSIX interface, a collection of processes that permits the signaling of related
processes.
process ID (PID)
In the POSIX interface, a unique positive integer the operating system associates with
each process. This is equivalent to the process's MIXNUMBER task attribute.
Q
queue
(1) A data structure used for storing objects; the objects are removed in the same order
they are stored. (2) In Data Communications ALGOL (DCALGOL), a linked list of
messages. (3) See also job queue, ready queue.
R
real group ID
In the POSIX interface, a process characteristic established when the process is created.
The real group ID identifies the group associated with the user who created the process.
The real group ID does not change for the lifetime of a process. See also group ID,
effective group ID.
real number
Any number, including fractions and whole numbers.
real user ID
In the POSIX interface, a process characteristic established when the process is created.
The real user ID identifies the user who created the process. The real user ID does not
change for the lifetime of a process. See user ID, effective user ID.
record-file
A term used to describe the type of disk file normally created and accessed by CANDE,
WFL, MARC, and traditional system applications. Conforming POSIX.1 applications only
create a record-file if an explicit request is made. The following file attributes define a
record-file: FILESTRUCTURE=ALIGNED180, FRAMESIZE=48. See also byte-file.
relative pathname
In the POSIX interface, a partial pathname used to locate a file or directory relative to the
current working directory. The system concatenates the current working directory and
the relative pathname to form an absolute pathname. See also absolute pathname, current
working directory.
root
(1) The origin of all directories and files in a file system structure. (2) In the UNIX system,
the user name for a superuser. (3) In the POSIX interface, the base directory of the file
system. All other directories and files are located under the root directory and can be
found by providing a full pathname from the root directory. The root directory is
represented with the slash character ( / ).
S
saved set-group-ID
In the POSIX interface, a process characteristic that allows flexibility in assigning the
effective group ID while executing certain code files. If the code file to be executed has
its SETGROUPCODE flag set, saved set-group-ID is set to the effective group ID of the
calling process when the code file is executed.
saved set-user-ID
In the POSIX interface, a process characteristic that allows flexibility in assigning the
effective user ID while executing certain code files. If the code file to be executed has its
SETUSERCODE flag set, saved set-user-ID is set to the effective user ID of the calling
process when the code file is executed.
semaphores
(1) A method used by NetWare for A Series to synchronize the association of resources
among both programs and processes. One use of semaphores is to provide a system of file
sharing and file locking. (2) In the POSIX interface, a structure used to synchronize
concurrent processes. Two types of semaphores can be used—those defined by X/Open
and those defined by POSIX.4. See named semaphore, unnamed semaphore.
signal
In the POSIX interface, a mechanism by which a process can be notified of or affected by
an event occurring in the system. Possible events include the expiration of a timer, a
hardware fault, or a task termination request. The term signal also refers to the event
itself.
signal catcher
A callable function that a process associates with a signal type. When the operating
system delivers a signal of this signal type, it interrupts the receiving process and causes
the process to execute the associated signal-catching function. See also catch a signal.
signal delivery
The operating system’s action of creating a signal in response to a specific event.
signal generation
Pertaining to the operating system’s action of creating a signal in response to a specific
event.
signal mask
A set of signals the process wants to block if they occur.
signal type
In the POSIX interface, a signal characteristic that determines its meaning and how it is
handled by the system.
stack
(1) A region of memory used to store data items in a particular order on a last-in, first-out
basis. (2) A nonpreferred synonym for process stack.
supplementary group ID
In the POSIX interface, a process characteristic that is used to determine file access
permissions. A process may have up to 16 supplementary group IDs in addition to the
effective group ID. These supplementary group IDs are set to the supplementary group
IDs of the parent process when the process is created. See group ID.
system command
Any of a set of commands used to communicate with the operating system. System
commands can be entered at an operator display terminal (ODT), in a Menu-Assisted
Resource Control (MARC) session, or by way of the DCKEYIN function in a privileged
Data Communications ALGOL (DCALGOL) program.
system library
A library that is part of the system software and is accorded special privileges by the
operating system. Two examples of system libraries are GENERALSUPPORT and
PRINTSUPPORT.
T
TAB
See task attribute block.
task
(1) A dependent process. (2) Any process, whether dependent or independent. See also
process.
task attribute
Any of a number of items that describe and control various aspects of process execution
such as the usercode, priority, and the default family specification. Task attributes can be
assigned interactively through task equations, or programmatically through statements
that use task variables.
timestamp
An encoded, 48-bit numerical value for the time and date. Various timestamps are
maintained by the system for each disk file. Timestamps note the time and date a file was
created, last altered, and last accessed.
U
unnamed semaphore
In the POSIX interface, a semaphore that a process refers to only by an integer identifier.
See semaphore, named semaphore.
user ID (UID)
In the POSIX interface, the unique number the operating system associates with a user
who logs on to the system. See also effective user ID, real user ID, usercode.
usercode
An identification code used to establish user identity and control security, and to provide
for segregation of files. Usercodes can be applied to every task, job, session, and file on
the system. A valid usercode is identified by an entry in the USERDATAFILE. In the
POSIX interface, the usercode is mapped to an equivalent effective user ID.
USERDATAFILE
A system database that defines valid usercodes and contains various data about each user
(such as accesscodes, passwords, and chargecodes) and the population of users for a
particular installation.
V
volume
The medium of a mass storage device such as a disk, disk pack, or tape reel. The term
volume is not restricted to the volume library on a cataloging system or the volume
directory on a system with tape volume security. For example, on the BTOS family of
workstations, the hard disk is a volume, and each floppy disk is a volume. When a volume
is initialized, it is assigned a volume name and an optional password.
W
working directory
In the POSIX interface, a directory associated with a process that is used in pathname
resolution for pathnames that do not begin with a slash ( / ). Synonymous with current
working directory.
X
X/Open
A UNIX-based common applications environment defined by the X/Open Company.
X/Open includes functional descriptions that are not defined by POSIX.1. Some of these
functions are considered extensions to POSIX.1.
_MCPstat( ), 5-28
_ access( ), 3-2, 5-14
alarm( ), 3-3, 5-36
_exit( ) function, 5-24
chdir( ), 3-4, 5-16
_fostat( ) function, 5-28
chmod( ), 3-5, 5-18
_MCPfostat( ) function, 5-28
chown( ), 3-6, 5-20
_MCPfstat( ) function, 5-28
close( ), 5-21
_MCPlstat( ) function, 5-28
creat( ), 5-38
_MCPstat( ) function, 5-28
ctermid( ), 5-61
cuserid( ), 5-61
dup( ), 5-25
A dup2( ), 5-25
execve( ), 3-7, 5-22
ACCESS function, 3-2, 6-7 exit( ), 5-24
access( ) function, 3-2, 5-14 fchmod( ), 5-18
ACT_PROC procedure, 2-9 fchown( ), 5-20
table, 2-10 fcntl( ), 5-25
adding signal to a set, 3-52 fork( ), 3-9, 5-30
ALARM function, 3-3, 6-8 fpathconf( ), 5-40
alarm signal, sending, 3-3 fstat( ), 5-28
alarm( ) function, 3-3, 5-36 getcwd( ), 3-10, 5-61
ALGOL include file getegid( ), 3-11, 5-35
description of, 2-2 geteuid( ), 3-12, 5-35
overview, 1-1 getgid( ), 3-13, 5-35
ALGOL programs, accessing POSIX functions getgrgid( ), 3-14, 5-31
in, 1-1 getgrnam( ), 3-15, 5-31
AMODE parameter, 2-19 getgroups( ), 3-16, 5-33
getlogin( ), 3-17, 5-61
getpgid( ), 3-18
B getpgrp( ), 5-35
getpid( ), 3-20, 5-35
blocking a signal type, 3-56, 3-65 getppid( ), 3-21, 5-35
by-reference, (See call-by-reference) getpwnam( ), 3-22, 5-32
by-value, (See call-by-value) getpwuid( ), 3-23, 5-32
getsgid( ), 5-35
getsid( ), 3-24
getsuid( ), 5-35
C getuid( ), 3-25, 5-35
kill( ), 3-28, 5-56
C language functions, emulated
lchmod( ), 5-18
_exit( ), 5-24
lchown( ), 5-20
_MCPfostat( ), 5-28
lseek( ), 5-42
_MCPfstat( ), 5-28
lstat( ), 5-28
_MCPlstat( ), 5-28
mkdir( ), 5-8
POSIX_NANOSLEEP, 5-37
H POSIX_OPEN, 5-38
POSIX_PATHCONF, 5-39
hardware information, obtaining, 3-73
POSIX_PIPE, 5-41
HOW parameter, 2-25
POSIX_SEEK, 5-42
POSIX_SEM_CLOSE, 5-43
POSIX_SEM_DESTROY, 5-44
I POSIX_SEM_GETVALUE, 5-45
POSIX_SEM_INIT, 5-46
include file, (See ALGOL include file) POSIX_SEM_OPEN, 5-47
INFO parameter, 2-26 POSIX_SEM_POST, 5-49
initializing POSIX_SEM_TRYWAIT, 5-50
empty signal set, 3-54 POSIX_SEM_UNLINK, 5-51
full signal set, 3-55 POSIX_SEM_WAIT, 5-52
INTARG parameter, 2-27 POSIX_SETIDS, 5-53
integer array input rule, 2-5 POSIX_SIGHANDLER, 5-55
integer array output rule, 2-5 POSIX_SREAD_E, 5-59
integer result rule, 2-18 POSIX_SREAD_R, 5-59
POSIX_STRINGIDS, 5-61
POSIX_SWRITE_E, 5-62
K POSIX_SWRITE_R, 5-62
POSIX_SYSCONF, 5-64
KILL function, 3-28 POSIX_TIME, 5-65
kill( ) function, 3-28, 5-56 POSIX_TIMES, 5-66
POSIX_UNAME, 5-67
POSIX_WAITPID, 5-68
procedure description format, 5-7
L login name, obtaining, 3-17
lseek( ) function, 5-42
lchmod( ) function, 5-18
lstat( ) function, 5-28
lchown( ) function, 5-20
library procedures
MCPX_MKNOD, 5-8
MCPX_SEMCTL, 5-10 M
MCPX_SEMGET, 5-12
MCPX_SEMOP, 5-13 MCPSTAT structure, 2-29
POSIX_ACCESS, 5-14 description of, 2-29
POSIX_ALLOCATE, 5-15 MCPX_MKNOD library procedure, 5-8
POSIX_CHANGEDIR, 5-16 MCPX_SEMCTL library procedure, 5-10
POSIX_CHANGEMODE, 5-17 MCPX_SEMGET library procedure, 5-12
POSIX_CHANGEOWNER, 5-19 MCPX_SEMOP library procedure, 5-13
POSIX_CLOSE, 5-21 mkdir( ) function, 5-8
POSIX_EXECVE, 5-22 MKFIFO function, 3-29
POSIX_EXIT, 5-24 MKFIFO special file, creating, 3-29
POSIX_FCNTL, 5-25 mkfifo( ) function, 3-29, 5-8
POSIX_FILE_TO_FD, 5-29 MODE parameter, 2-28
POSIX_FILESTATUS, 5-27
POSIX_FORK, 5-30
POSIX_GETGRINFO, 5-31 N
POSIX_GETPWINFO, 5-32
POSIX_GROUPLIST, 5-33 NAME parameter (for PATHCONF), 2-30
POSIX_INTEGERIDS, 5-34 NAME parameter (for SYSCONF), 2-31
POSIX_NANOALARM, 5-36 NICE function, 3-30, 5-54