Detailed description of fcntl functions for file control and fcntl functions for control
Abstract:This article mainly discusses the basic application of the fcntl function for file control. the dup function can copy file descriptors, while the fcntl
Abstract:This article mainly discusses the basic application of the fcntl function for file control. the DUP function can copy file descriptors, while the fcntl function is similar to the DUP function. in addition, it provides more powerful
Linux Network Programming-file attributes fcntl Function
/* Use the fcntl control file operator */# include
# Include
# Include
Int main (void) {int flags =-1; int accmode =-1;/* Get the status of the standard input
Sys/types. h
Is the header file of the basic system data type of Unix/Linux systems, including size_t, time_t, pid_t and other types.
The application source file contains to access the definition of _ lp64 and _ ilp32. This header file also
Name------------Fcntlint fcntl (int fd, int cmd, .../*arg*/)----------------The manipulate file descriptor/* action Descriptor */To include a header file:#include #include The function performs one of the operations described below on the open file
Differences between fcntl (), lockf, and flock in linux. What are the differences between fcntl (), lockf, and flock in linux? what are the differences between fcntl (), lockf, and flock? the functions of lvyilong316 are used to lock files? First,
Refer to the differences between FCNTL (), LOCKF, flock in LinuxWhat is the difference between these three functions , which are all about locking up a file?First flock and fcntl are system calls, and LOCKF is a library function . LOCKF is actually
I. fcntl Functions
Function: manipulate the file descriptor to change the attributes of an opened file.
Int fcntl (int fd, int cmd,.../* Arg */);
The cmd value can be as follows:
Copy file descriptorF_dupfd (long)
Set/Get file descriptor
Function Description: Manipulate file characteristics According to the file description.#include #include int fcntl (int fd, int cmd);int fcntl (int fd, int cmd, long arg);int fcntl (int fd, int cmd, struct flock *lock);DescriptionFCNTL () provides
Transferred from: http://www.cnblogs.com/lonelycatcher/archive/2011/12/22/2297349.htmlFunction Description: Manipulate file characteristics According to the file description.#include #include int fcntl (int fd, int cmd);int fcntl (int fd, int cmd,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.