Section C.3. HP-UX and Linux System Calls Comparison Table


C.3. HP-UX and Linux System Calls Comparison Table

Table C-3. HP-UX and Linux System Calls Comparison Table

HP-UX System Calls[6]

Linux Equivalent

Description

accept

accept

Accept connection on a socket.

access

access

Determine accessibility of a file.

acct

None

Enable or disable process accounting.

acl

None

Set a file's ACL information.

adjtime

adjtime

Correct the time to synchronize the system clock.

aio_cancel

aio_cancel, aio_cancel64

Cancel asynchronous I/O operation.

aio_error

aio_error, aio_error64

Return error status of asynchronous I/O operation.

aio_fsync

aio_fsync, aio_fsync64

Synchronize asynchronous I/O operations.

aio_read

aio_read, aio_read64

Start asynchronous read operation.

aio_reap

None

Wait for multiple asynchronous I/O requests.

aio_return

aio_return, aio_return64

Return asynchronous I/O operation status.

aio_suspend

aio_suspend, aio_suspend64

Suspend for asynchronous I/O operation.

aio_write

aio_write, aio_write64

Start asynchronous write operation.

alarm

alarm

Set a process's alarm clock.

audctl

None

Start or halt auditing system; set or get audit files.

audswitch

None

Suspend or resume auditing on current process.

audwrite

None

Write audit record for self-auditing process.

bind

bind

Bind an address to a socket.

brk

brk

Change data segment space allocation.

chdir

chdir

Change working directory.

chmod

chmod

Change file mode access permissions.

chown

chown

Change owner and group of a file.

chroot

 

Change root directory.

clock_getres

clock_gettime

Clock operations.

clock_gettime

clock_gettime

Clock operations.

clock_settime

clock_gettime

Clock operations.

close

close

Close a file descriptor.

connect

connect

Initiate a connection on a socket.

crashcon

None

Configure system crash dumps.

creat

creatmay return ENODEV in place of ENXIO as specified by SUSv3[7]

Create a new file or rewrite an existing one.

creat64

create64

Non-POSIX standard API interfaces to support large files (HP-UX).

dup

dup

Duplicate an open file descriptor.

dup2

dup2

Duplicate an open file descriptor to a specific slot.

errno

errno (not an API)

Error indicator for system calls.

exec, execl, execle, execlp, execv, execve, execvp

exec, execl, execle, execlp, execv, execve, execvp

Execute a file.

exit

exit

Terminate a process.

fchdir

fchdir

Change working directory.

fchmod

fchmod

File mode access permissions.

fchown

fchown

Change owner and group of a file.

fcntl

fcntl

File control.

FD_CLR, FD_ISSET FD_SET, FD_ZERO

FD_CLR, FD_ISSET FD_SET, FD_ZERO

Synchronous I/O multiplexing (see select).

fdatasync

fdatasync

Synchronize a file's in-core state with its state on disk.

fgetacl

None

Get access control list (ACL) information.

fork

fork

Create a new process.

fpathconf

fpathconf

Get configurable path name variables.

fsctl

None

Filesystem control.

fsetacl

None

Access control list (ACL) information.

fstat

fstat

Get file status.

fstat64

fstat64

Non-POSIX standard API interfaces to support large files.

fstatfs

fstatfs

Get file status.

fstatvfs

fstatvfs

Get file status.

fstatvfs64

fstatvfs64

Non-POSIX standard API interfaces to support large files.

fsync, fdatasync

fsync

Synchronize a file's in-core state with its state on disk.

ftime

ftime

Get date and time more precisely.

ftruncate

ftruncate

Truncate a file to a specified length.

ftruncate64

ftruncate64

Non-POSIX standard API interfaces to support large files.

getaccess

None

Get a user's effective access rights to a file.

getacl, fgetacl

None

Get access control list (ACL) information.

getaudid

getaudid

Get the audit ID (aid()) for the current process.

getaudproc

None

Get audit process flag for calling process.

getcontext

getcontext

Get and set current user context.

getdirentries

getdirentries

Get entries from a directory in a filesystem-independent format.

getdomainname

getdomainname

Get/set name of current nis domain.

getegid

getegid

Get effective group ID.

geteuid

geteuid

Get effective user group ID.

getevent

None

Get events and system calls currently being audited.

getfh

None

Get file handle for file on remote node.

getgid

getgid

Get real group ID.

getgroups

getgroups

Get group access list.

gethostid

gethostid

Get an identifier for the current host.

gethostname

gethostname

Get name of current host.

getitimer

getitimer

Get value of interval timer.

getksym

None

Get information for a global kernel symbol.

getms

None

Receive next message from a streams file.

getpagesize

getpagesize

Get the current page size.

getpeername

getpeername

Get address of connected peer.

getpgid

getpgid

Get process group ID.

getpgrp

getpgrp

Get process group ID.

getpgrp2

None

Get process group ID of specified process.

getpid, getpgid, getpgrp, getpgrp2, getppid

getpid, getpgid, getpgrp, getppid

Get process, process group, and parent process ID.

getpmsg

None

Receive next message from a streams file in a priority order.

getpriority, setpriority

getpriority, setpriority

Get or set process priority.

getprivgrp, setprivgrp

None

Get and set special attributes for group.

geTRlimit, setrlimit

getrlimit, setrlimit

Control consumption of system resources.

geTRlimit64

getrlimit64

Non-POSIX standard API interfaces to support large files.

getrusage

geTRusage

Get information about resource utilization.

getsid

getsid

Get session ID.

getsockname

getsockname

Get socket address.

getsockopt

getsockopt

Get or set options on sockets.

gettimeofday

gettimeofday

Get the date and time.

gettune

None

Get value of a kernel tunable parameter.

getuid, geteuid, getgid, getegid

getuid, geteuid, getgid, getegid

Get real user, effective user, real group and effective group IDs.

gtty

gtty

Bsd terminal modes.

ioctl

ioctl

Control device.

iscomsec

None

Check if system has been converted to a trusted system.

kill

killLSB specification says if pid is -1, sig shall not be sent to the calling process.

Send a signal to a process or a group of processes.

killpg, getpgrp, setpgrp

killpg, getpgrp, setpgrp

4.2 BSD-compatible process control facilities.

lilockf

None

Provide semaphores and record locking on files.

link

link

Link to a file.

lio_listio

lio_listio, lio_listio64

Start a list of asynchronous I/O operations.

listen

listen

Listen for connections on a socket.

loadmod

None

Load kernel modules on demand.

lockf64

lockf64

Non-POSIX standard API interfaces to support large files.

lseek

lseek

Move read/write file pointer; seek.

lseek64

lseek64

Non-POSIX standard API interfaces to support large files.

lstat

lstat

Get symbolic link status.

lstat64

lstat64

Non-POSIX standard API interfaces to support large files.

madvise

madvise

Advise system of process's expected paging behavior.

makecontext, swapcontext

makecontext, swapcontext

Manipulate user contexts,.

mkdir

mkdir

Make a directory file.

mknod

mknod

Make directory, special, or ordinary file.

mlock

mlock

Lock segment of process address space in memory.

mlockall

mlockall

Lock process address space in memory.

mmap

mmap[8]

Map object into virtual memory.

mmap64

mmap64[9]

Non-POSIX standard API interfaces to support large files.

modpath

None

Change global search path for dynamically loadable kernel modules.

modstat

None

Get information for a dynamically loaded kernel module.

moduload

None

Unload a kernel module on demand.

mount

mount

Mount a filesystem.

mpctl

None

Multiprocessor control.

mprotect

mprotect

Modify memory mapping access protections.

mq_close

mq_close[10]

Close a message queue descriptor.

mq_getattr

mq_getattr

Get status information and attributes associated with a message queue.

mq_notify

mq_notify

Register/cancel a notification request with a message queue.

mq_open

mq_open

Create/open a message queue.

mq_receive

mq_receive

Receive a message from a message queue.

mq_send

mq_send

Send a message to a message queue.

mq_setattr

mq_setattr

Set the blocking status of a message queue associated with a descriptor.

mq_unlink

mq_unlink

Unlink a message queue.

msem_init

None

Initialize semaphore in mapped file or anonymous memory region.

msem_lock

None

Lock a semaphore.

msem_remove

None

Remove semaphore in mapped file or anonymous region.

msem_unlock

None

Unlock a semaphore.

msgctl

msgctl

Message control operations.

msgget

msgget

Get message queue.

msgop

msgop

Message operations.

msgrcv

msgrcv

Receive message from message queue.

msgsnd

msgsnd

Send message to message queue.

msync

msync

Synchronize a mapped file.

munlock

munlock

Unlock segment of process virtual address space.

munlockall

munlockall

Unlock process virtual address space.

munmap

munmap

Unmap a mapped region.

nanosleep

nanosleep

High-resolution sleep.

nice

nice

Change priority of a process.

O_LARGEFILE

O_LARGEFILE

Non-POSIX standard API interfaces to support large files.

open

openLSB specifications says open may return ENODEV in place of ENXIO

Open file for reading or writing.

open64

open64

Non-POSIX standard API interfaces to support large files.

pathconf

pathconf

Get configurable path name variables.

pause

pause

Suspend process until signal.

pipe

pipe

Create an interprocess channel.

plock

mlockall

Lock process, text, data, stack, or shared library in memory.

poll

poll

Monitor I/O conditions on multiple file descriptors.

pread

pread

Read from file.

pread64

pread64

Non-POSIX standard API interfaces to support large files.

prealloc

None

Pre-allocate fast disk storage.

prealloc64

None

Non-POSIX standard API interfaces to support large files.

PRI_HPUX_TO_POSIX

None

Return POXIX.4 process priority.

PRI_POSIX_TO_HPUX

None

Return HP-UX process priority.

profil

profil

Execution time profile.

pset_assign

None

Change processor set assignment.

pset_bind

None

Bind a process or a thread to a processor set.

pset_create

None

Create a processor set.

pset_ctl

None

Processor set control.

pset_destroy

None

Destroy processor set.

pset_getattr

None

Processor set control API.

pset_setattr

None

Processor set control API.

pstat pstat_getcommandline, pstat_getcrashdev, pstat_getcrashinfo, pstat_getdisk, pstat_getdynamic, pstat_getfile, pstat_getfile2, pstat_getfiledetails, pstat_getipc, pstat_getlv, pstat_getlwp, pstat_getmpathname, pstat_getmsg, pstat_getnode, pstat_getpathname, pstat_getpmq, pstat_getproc, pstat_getprocessor, pstat_getprocvm, pstat_getpsem, pstat_getpset, pstat_getsem, pstat_getshm, pstat_getsocket, pstat_getstable, pstat_getstream, pstat_getswap, pstat_getvminfo, pstat_static

None

Get system information.

ptrace

ptrace

Process trace.

putmsg

None

Send a message on a stream.

putpmsg

None

Send a message on a stream in different priority bands.

pw_getukid, pw_wait, pw_post, pw_postv, pw_getvmax

None

Lightweight synchronization mechanism.

pw_getukid

None

Lightweight synchronization mechanism.

pw_getvmax

None

Lightweight synchronization mechanism.

pw_post

None

Synchronization mechanism.

pw_postv

None

Lightweight synchronization mechanism.

pw_wait

None

Lightweight synchronization mechanism.

pwrite

pwrite

Write to file.

pwrite64

pwrite64

Non-POSIX standard API interfaces to support large files.

quotactl

None

Manipulate disk quotas.

raise

raise

Send a signal to executing program.

read

read

Read input.

readlink

readlink

Read value of a symbolic link.

readv

readv

Read input.

reboot

reboot[11]

Boot the system.

recv

recv

Receive message from a socket.

recvfrom

recvfrom

Receive message from a socket.

recvmsg

recvmsg

Receive message from a socket.

rename

rename

Change the name of a file.

rmdir

rmdir

Remove a directory file.

rtprio

None

Change or read real-time priority.

sbrk

sbrk

Change data segment space allocation.

sched_get_priority_max

sched_get_priority_max

Return maximum for scheduling policy.

sched_get_priority_min

sched_get_priority_min

Return minimum for scheduling policy.

sched_getparam

sched_getparam

Return scheduling parameters.

sched_getscheduler

sched_getscheduler

Return scheduling policy.

sched_rr_get_interval

sched_rr_get_interval

Update execution time limit.

sched_setparam

sched_setparam

Set scheduling parameters.

sched_setscheduler

sched_setscheduler

Set scheduling policy.

sched_yield

sched_yield

Force process to relinquish processor.

select

select

Synchronous I/O multiplexing.

sem_close

sem_close

Close a named semaphore.

sem_destroy

sem_destroy

Destroy an unnamed semaphore.

sem_getvalue

sem_getvalue

Read a POSIX semaphore.

sem_init

sem_init

Initialize an unnamed semaphore.

sem_open

sem_open

Open/create a named semaphore.

sem_post

sem_post

Unlock a POSIX semaphore.

sem_trywait

sem_trywait

Lock a POSIX semaphore without blocking.

sem_unlink

sem_unlink

Unlink a named semaphore.

sem_wait

sem_wait

Lock a POSIX semaphore.

semctl

semctl

Semaphore control operations.

semget

semget

Get set of semaphores.

semop

semop

Semaphore operations.

semtimedop

semtimedop

Semaphore operations.

send

send

Send message to a socket.

sendfile

None

Send the contents of a file through a socket.

sendfile64

None

Send the contents of a file through a socket.

sendmsg

None

Send message to a socket.

sendto

sendto

Send message to a socket.

serialize

None

Force target process to run serially with other processes.

setacl

None

Set access control list (ACL) information.

setaudid

None

Set audit ID (aid()) for current process.

setaudproc

None

Set or clear auditing on calling process.

setcontext

setcontext

Get and set current user context.

setevent

None

Set current events and system calls to be audited.

setgid

setgid

Set group ID.

setgroups

setgroups

Set group access list.

sethostname

sethostname (maximum length of host name may not be equal to POSIX equivalent of HOST_NAME_MAX)

Set name of host CPU.

setitimer

setitimer

Set value of interval timer.

setpgid

setpgid

Set process group ID for job control.

setpgrp

setpgrp

Set process group ID.

setpgrp2

None

Set process group ID.

setpgrp3

None

Create session and set process group ID.

setpriority

setpriority

Set process priority.

setprivgrp

None

Set special attributes for group.

setregid

setregid

Set the real and effective group IDs.

setresgid

setresgid

Set real, effective, and saved group IDs.

setresuid

setresuid

Set real and effective user IDs.

setrlimit

setrlimit

Control consumption of system resources.

setrlimit64

setrlimit64

Non-POSIX standard API interfaces to support large files.

setsid

setsid

Create session and set process group ID.

setsockopt

setsockopt

Set options on sockets.

settimeofday

settimeofday

Set the date and time.

settune

None

Set value of a kernel tunable parameter.

settune_txn

None

Sets the values of kernel tunable parameters in a transaction.

setuid

setuid

Set user and group IDs.

setuname

None

Set node name (system name).

shm_open

shm_open

Create/open a shared memory object.

shm_unlink

shm_unlink

Unlink a shared memory object.

shmat

shmat

Attach shared memory to data segment.

shmctl

shmctl

Shared memory control operations.

shmdt

shmdt

Detach shared memory from data segment.

shmget

shmget

Get shared memory segment.

shmop

shmop

Shared memory operations.

shutdown

shutdown

Shut down a socket.

sigaction

sigaction

Examine and change signal action.

sigaltstack

sigaltstack

Set and/or get signal alternate stack context.

sigblock

sigblock

Block signals.

sighold, sigrelse

sighold, sigrelse

Signal management.

sigignore

sigignore

Signal management.

siginterrupt

siginterrupt

Allow signals to interrupt functions.

sigpause

sigpause

Signal management.

signal

signal

4.2 bsd-compatible process control facilities.

sigpending

sigpending

Examine pending signals.

sigprocmask

sigprocmask

Examine and change blocked signals.

sigqueue

sigqueue

Queue a signal to a process.

sigsend

None

Send a signal to a process or a group of processes.

sigsendset

None

Send a signal to a group of processes.

sigsetmask

sigsetmask

Set current signal mask.

sigspace

None

Assure sufficient signal stack space.

sigstack

sigstack

Set and/or get signal stack context.

sigsuspend

sigsuspend

Wait for a signal.

sigtimedwait

sigtimedwait

Examine and change signal action.

sigvec

sigvec

4.2 BSD-compatible process control facilities.

sigvector

None

Software signal facilities.

sigwait

sigwait

Examine and change signal action.

sigwaitinfo

sigwaitinfo

Examine and change signal action.

socket

socket

Create an endpoint for communication.

socketpair

socketpair

Create a pair of connected sockets.

sprofil

None

Execution time profile for disjointed text spaces.

stat

stat

Get file status.

stat64

stat64

Non-POSIX standard API interfaces to support large files.

statfs

statfs

Get file system statistics.

statvfs

statvfs

Get file status.

statvfs64

statvfs64

Non-POSIX standard API interfaces to support large files.

stime

stime

Set time and date.

stream

None

Streams enhancements to standard system calls.

stty

stty

Control terminal device (bell version 6 compatibility).

swapcontext

swapcontext

Manipulate user contexts.

swapon

swapon

Add swap device for interleaved paging and swapping.

symlink

symlink

Make symbolic link to a file.

sync

sync

Update disk.

sysconf

sysconf

Get configurable system variables.

sysfs

sysfs

Get filesystem type info.

time

time

Get time.

timer_create

timer_create

Create timer.

timer_delete

timer_delete

Delete timer.

timer_getoverrun

timer_getoverrun

Return timer expiration count.

timer_gettime

timer_gettime

Store timer expiration and reload value.

timer_settime

timer_settime

Set timer expiration.

times

times

Get process and child process times.

TRuncate

truncate

Truncate a file to a specified length.

TRuncate64

TRuncate64

Non-POSIX standard API interfaces to support large files.

ttrace

None

Tracing facility for multithreaded processes.

ttrace_wait

None

Wait for ttrace() request.

tuneinfo2

None

Retrieve detailed information about kernel tunable parameters.

ualarm

ualarm

Set the interval timer.

ulimit

ulimit

Get and set user limits.

umask

umask

Set and get file creation mask.

umount

umount, umount2

Unmount a file system.

uname

uname

Get information about computer system; set node name (system name).

unlink

unlink (may return EISDIR instead of EPERM as specified by SUSv3[12])

Remove directory entry; delete file.

usleep

usleep

Suspend execution for an interval.

ustat

ustat

Get mounted file system statistics.

utime

utime

Set file access and modification times.

utimes

utimes

Set file access and modification times.

vfork

vfork

Spawn new process (use fork() instead).

vfsmount

None

Mount a file system.

wait

wait

Wait for child process to stop or terminate.

wait3, wait4

wait3 (works as specified in SUSv2 except WCONTINUED and WIFCONTINUED are optional)

Wait for child process to change state.

 

wait4 (waits for process termination, BSD style)

 

waitid

waitid

Wait for child process to change state.

waitpid

waitpidworks as specified in SUSv3 except WCONTINUED and WIFCONTINUED are optional

Wait for child process to stop or terminate.

write

write

Write data to a file.

writev

writev

Write data to a file.


[6] HP-UX Reference Section 2: System Calls HP-UX 11i v2

[7] www.unix.org/version3/

[8] Some flags may not be compatible.

[9] This is not documented in the Linux man pages. See /usr/include/mman.h and /usr/include/bits/mman.h.

[10] All message queue functions defined in mqueue.h are available only on Linux 2.6 systems that define _POSIX_MESSAGE_PASSING. Systems such as SUSE 9.1 do not define it, and hence mq_* functions are not available.

[11] Takes different arguments.

[12] www.unix.org/version3/




UNIX to Linux Porting. A Comprehensive Reference
UNIX to Linux Porting: A Comprehensive Reference
ISBN: 0131871099
EAN: 2147483647
Year: 2004
Pages: 175

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net