Specifications

Red Hat Enterprise Linux to Oracle Solaris Porting Guide
22
available on Oracle Solaris, either as system calls or library functions (APIs). There are some minor
differences in system call implementation on the two platforms.
Table 3-1 lists the implementation differences in terms of differences in the number of parameters,
return values, or changes in the headers file names where the system call signatures are declared. The
table also gives the workaround or alternate function call that needs to be used on Oracle Solaris 11 so
that code originally written to work on RHEL can compile and work on Oracle Solaris 11.
There are also some system calls that are available on only one platform. For such system calls, more
time and effort will have to be spent during the migration.
TABLE 3-1. EQUIVALENT SYSTEM CALLS, ALTERNATIVE SYSTEM CALLS, AND WORKAROUNDS
API SYNOPSIS ON LINUX FOR ORACLE SOLARIS 11
access #include <unistd.h>
int access(const char *pathname, int
mode);
Signature on Oracle Solaris is the same.
On Oracle Solaris, need to additionally include:
#include <sys/fcntl.h>
chown #include <unistd.h>
int chown(const char *path, uid_t
owner, gid_t group);
Signature on Oracle Solaris is the same.
On Oracle Solaris, need to additionally
include:#include <sys/types.h>
creat #include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int creat(const char *pathname, mode_t
mode);
Signature on Oracle Solaris is the same.
Does not require sys/types.h.
faccessat #define _ATFILE_SOURCE
#include <fcntl.h>
/* Definition of AT_* constants */
#include <unistd.h>
int faccessat(int dirfd, const char
*pathname, int mode, int flags);
Signature on Oracle Solaris is the same.
Requires #include <sys/fcntl.h> instead of
#include <fcntl.h>.
#define _ATFILE_SOURCE not required.
fchmodat #define _ATFILE_SOURCE
#include <fcntl.h> /* Definition of
AT_* constants */ #include <sys/stat.h>
int fchmodat(int dirfd, const char
*pathname, mode_t mode, int flags);
Signature on Oracle Solaris is the same.
Does not require #define _ATFILE_SOURCE and
#include <fcntl.h>.
fchown #include <unistd.h>
int fchown(int fd, uid_t owner, gid_t
group);
Signature on Oracle Solaris is the same.
Requires #include <sys/types.h>.
fchownat #define _ATFILE_SOURCE
#include <fcntl.h> /* Definition of
Signature on Oracle Solaris is the same.
Does not require #define _ATFILE_SOURCE and