|
|
发表于 2008-6-3 14:06:57
|
显示全部楼层
你如果要LINUX下开发函数的MANPAGE的话,需要安装manpages-dev这个包
txi@ghosTunix:~$ aptitude search manpages-dev
i manpages-dev - Manual pages about using GNU/Linux for development
安装完成后就可以查询各种函数接口的man了
txi@ghosTunix:~$ man 2 open
OPEN(2) Linux Programmer's Manual OPEN(2)
NAME
open, creat - open and possibly create a file or device
SYNOPSIS
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int open(const char *pathname, int flags);
int open(const char *pathname, int flags, mode_t mode);
int creat(const char *pathname, mode_t mode);
DESCRIPTION
Given a pathname for a file, open() returns a file descriptor, a small, non-negative integer for
use in subsequent system calls (read(2), write(2), lseek(2), fcntl(2), etc.). The file descrip-
tor returned by a successful call will be the lowest-numbered file descriptor not currently open
for the process.
By default, the new file descriptor is set to remain open across an execve(2) (i.e., the
FD_CLOEXEC file descriptor flag described in fcntl(2) is initially disabled; the Linux-specific
O_CLOEXEC flag, described below, can be used to change this default). The file offset is set to
the beginning of the file (see lseek(2)).
A call to open() creates a new open file description, an entry in the system-wide table of open
files. This entry records the file offset and the file status flags (modifiable via the fcntl(2)
F_SETFL operation). A file descriptor is a reference to one of these entries; this reference is
unaffected if pathname is subsequently removed or modified to refer to a different file. The new
open file description is initially not shared with any other process, but sharing may arise via
fork(2).
Manual page open(2) line 1 |
|