06.08.2013 Views

pSOSystem System Calls - Read

pSOSystem System Calls - Read

pSOSystem System Calls - Read

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

lstat_f pHILE+ <strong>System</strong> <strong>Calls</strong><br />

Return Value<br />

This structure cannot be packed. No time zone is associated with the<br />

time values.<br />

mode_t, ino_t, dev_t, nlink_t, uid_t, gid_t, off_t, and time_t<br />

are defined as unsigned long in .<br />

The status information word st_mode consists of the following bits:<br />

S_IFMT 0170000 /* type of file */<br />

S_IFIFO 0010000 /* fifo special */<br />

S_IFCHR 0020000 /* character special */<br />

S_IFDIR 0040000 /* directory */<br />

S_IFBLK 0060000 /* block special */<br />

S_IFREG 0100000 /* regular file */<br />

S_IFLNK 0120000 /* symbolic link */<br />

S_IFSOCK 0140000 /* socket */<br />

S_ISUID 0004000 /* set user ID on execution */<br />

S_ISGID 0002000 /* set group ID on execution */<br />

S_ISVTX 0001000 /* save swapped text even after use */<br />

S_IREAD 0000400 /* read permission, owner */<br />

S_IWRITE 0000200 /* write permission, owner */<br />

S_IEXEC 0000100 /* execute/search permission, owner */<br />

S_IRGRP 0000040 /* read permission, group */<br />

S_IWGRP 0000020 /* write permission, group */<br />

S_IXGRP 0000010 /* execute/search permission, group */<br />

S_IROTH 0000004 /* read permission, other */<br />

S_IWOTH 0000002 /* write permission, other */<br />

S_IXOTH 0000001 /* execute/search permission, other */<br />

This system call returns 0 on success or an error code on failure.<br />

2-62 <strong>pSO<strong>System</strong></strong> <strong>System</strong> <strong>Calls</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!