Table A-2 provides the system call comparison between Solaris and Linux.
Table A-2. System Calls Comparison
Solaris | Linux | Description |
---|
access | access | Check user's permission for a file. |
acct | acct | Switch process accounting on or off. |
acl, facl | None | Get or set a file's access control list (ACL). |
adjtime | adjtimex | Correct the time to allow synchronization of the system clock. |
alarm | alarm | Schedule an alarm signal. |
audit | None | Write a record to the audit log. |
auditon | None | Manipulate auditing. |
auditsvc | None | Write audit log to specified file descriptor. |
brk | brk | Change data segment size. |
chdir | chdir | Change working directory. |
chmod | chmod | Change permissions of a file. |
chown | chown | Change ownership of a file. |
chroot | chroot | Change root directory. |
close | close | Close a file descriptor. |
creat | creat | Create a new file or rewrite an existing one. |
dup | dup | Duplicate a file descriptor. |
exec | exec | Execute a file. |
exit | exit | Terminate the current process. |
fcntl | fcntl | Manipulate file descriptor. |
fork, fork1 | fork | Create a child process. |
fpathconf, pathconf | fpathconf, pathconf | Get configuration values for files. |
futimesat | None | Set file access and modification times. It resolves the path relative to the fildes argument. |
getacct, putacct, wracct | None | Get, put, or write extended accounting data. |
getaudit, setaudit, getaudit_addr, setaudit_addr | None | Get and set process audit information. |
getauid, setauid | None | Get and set user audit identity. |
getcontext, setcontext | getcontext, setcontext | Get and set current user context. |
geTDents | getdents | Read directory entries and put in a filesystem-independent format. Dirent structure on Linux and Solaris differs. |
getgroups, setgroups | getgroups, setgroups | Get or set supplementary group access list IDs. |
getitimer, setitimer | getitimer, setitimer | Get or set value of interval timer. |
getmsg, getpmsg | getmsg, getpmsg | Get next message off a stream. |
getpflags, setpflags | None | Get or set process flags. |
getpid, getpgrp, getppid, getpgid | getpid, getpgrp, getppid, getpgid | Get process, process group, and parent process IDs. |
getppriv, setppriv | None | Get or set a privilege set. |
getrlimit, setrlimit | geTRlimit, setrlimit | Control maximum system resource consumption. |
getsid | getsid | Get process group ID of session leader. |
getuid, geteuid, getgid, getegid | getuid, geteuid, getgid, getegid | Get real user, effective user, real group, and effective group IDs. |
getustack, setustack | None | Retrieve or change the address of per-LWP stack boundary information. |
ioctl | ioctl | Control device. |
issetugid | None | Determine whether current executable is running setuid or setgid. |
kill | kill | Send a signal to a process or a group of processes. |
link | link | Make a new name for a file. |
llseek | _llseek | Move extended read/write file pointer. |
lseek | lseek | Move read/write file pointer. |
_lwp_cond_signal, _lwp_cond_broadcast | None | Signal a condition variable. |
_lwp_cond_wait, _lwp_cond_timedwait, _lwp_cond_reltimedwaid | None | Wait on a condition variable. |
_lwp_info | None | Return the time-accounting information of a single LWP. |
_lwp_kill | None | Send a signal to an LWP. |
_lwp_mutex_lock, _lwp_mutex_unlock, _lwp_mutex_trylock | None | Mutual exclusion. |
_lwp_self | None | Get LWP identifier. |
_lwp_sema_wait, _lwp_sema_trywait, _lwp_sema_init, _lwp_sema_post | None | Semaphore operations. |
_lwp_suspend, _lwp_continue | None | Continue or suspend LWP execution. |
memcntl | None | Memory management control. |
meminfo | None | Provide information about memory. |
mincore | mincore | Determine residency of memory pages. |
mkdir | mkdir | Create a directory. |
mknod | mknod | Make a directory, a special file, or a regular file. |
mmap | mmap | Map pages of memory. |
mount | mount | Mount a filesystem. The signatures of this system call on Solaris and Linux differ. |
mprotect | mprotect | Set protection of memory mapping. |
msgctl | msgctl | Message control operations. |
msgget | msgget | Get a message queue identifier. |
msgids | None | Discover all message queue identifiers. |
msgrcv | msgrcv | Message receive operation. Linux uses struct msgbuf type in one of its arguments. |
msgsnap | None | Message queue snapshot operation. |
msgsnd | msgsnd | Message send operation. Linux uses struct msgbuf type in one of its arguments. |
munmap | munmap | Unmap pages of memory. |
nice | nice | Change priority of a process. |
ntp_adjtime | ntp_adjtime | Adjust local clock parameters. |
ntp_gettime | ntp_gettime | Get local clock values. |
open, openat | open | Open a file. openat() is not available in Linux. |
pause | pause | Suspend process until signal. |
pcsample | None | Program execution time profile. |
pipe | pipe | Create an interprocess channel. |
poll | poll | Input/output multiplexing. |
p_online | None | Return or change processor operational status. |
priocntl | None | Process scheduler control. |
priocntlset | None | Generalized process scheduler control. |
processor_bind | sched_setaffinity | Bind LWPs to a processor. For more info about sched_setaffinity, see the "CPU Affinity" section in Chapter 4, "Porting Solaris Applications." |
processor_info | None | Determine type and status of a processor. |
profil | profil | Execution time profile. |
pset_bind | sched_setaffinity | Bind LWPs to a set of processors. For more info about sched_setaffinity, see the "CPU Affinity" section in Chapter 4. |
pset_create, pset_destroy, pset_assign, pset_info, pset_list, pset_setattr, pset_getattr | None | Manage sets of processors. There is no exact match in Linux, but CPU affinity is supported in Linux. For more information, see the "CPU Affinity" section in Chapter 4. |
putmsg, putpmsg | None | Send a message on a stream. |
read, readv, pread | read, readv, pread | Read from file. |
readlink | readlink | Read the contents of a symbolic link. |
rename, renameat | rename | Change the name of a file. Linux does not have renameat(). |
resolvepath | None | Resolve all symbolic links of a path name. |
rmdir | rmdir | Remove a directory. |
semctl | semctl | Semaphore control operations. |
semget | semget | Get set of semaphores. |
semids | None | Discover all semaphore identifiers. |
semop, semtimedop | semop, semtimedop | Semaphore operations. |
setpgid | setpgid | Set process group ID. |
setpgrp | setpgrp | Set process group ID. |
setrctl, getrctl | None | Set or get resource control values. |
setregid | setregid | Set real and effective group IDs. |
setreuid | setreuid | Set real and effective user IDs. |
setsid | setsid | Create session and set process group ID. |
settaskid, gettaskid, getprojid | None | Set or get task or project IDs. |
setuid, setegid, seteuid, setgid | setuid, setegid, seteuid, setgid | Set user and group IDs. |
shmctl | shmctl | Shared memory control operations. |
shmget | shmget | Get shared memory segment identifier. |
shmids | None | Discover all shared memory identifiers. |
shmop, shmat, shmdt | shmop, shmat, shmdt | Shared memory operation. |
sigaction | sigaction | Detailed signal management. |
sigaltstack | sigaltstack | Set or get signal alternate stack context. |
sigpending | sigpending | Examine signals that are blocked and pending. |
sigprocmask | sigprocmask | Change or examine caller's signal mask. |
sigsend, sigsendset | None | Send a signal to a process or a group of processes. |
sigsuspend | sigsuspend | Install a signal mask and suspend caller until signal is received. |
sigwait | sigwait | Wait until a signal is posted. |
__sparc_utrap_install | None | Install a SPARC V9 user trap handler. |
stat, lstat, fstat | stat, lstat, fstat | Get file status. |
fstatat | None | Get file status. |
statvfs, fstatvfs | statvfs, fstatvfs | Get file system statistics. |
stime | stime | Set system time and date. |
swapctl | None | Manage swap space. |
symlink | symlink | Make a symbolic link to a file. |
sync | sync | Update super block. |
sysfs | sysfs | Get file system type information. |
sysinfo | sysinfo | Return information on overall system statistics. |
time | time | Get time in seconds. |
times | times | Get process times. |
uadmin | None | Administrative control. |
ulimit | ulimit | Get and set process limits. |
umask | umask | Set and get file creation mask. |
umount, umount2 | umount, umount2 | Unmount a file system. |
uname | uname | Get name of current operating system. |
unlink, unlinkat | unlink | Remove directory entry. Linux does not have unlinkat(). |
ustat | ustat | Get file system statistics. |
utime | utime | Set file access and modification times. |
utimes | utimes | Set file access and modification times. |
vfork | vfork | Spawn new process in a virtual-memory-efficient way. |
vhangup | vhangup | Virtually hang up the current tty. |
waitid | None | Wait for child process to change state. |
write, pwrite, writev | write, pwrite, writev | Write on a file. |
yield | sched_yield | Yield execution to another lightweight process. |