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,
FcntlFunction Description: Manipulate the attributes of the file 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
There are two types of fcntl File locks:
Create locksAnd
Mandatory lock
The locks are defined as follows: every process that uses a lock file must check whether a lock exists. Of course, you must respect the existing locks. In general, the kernel
getsockopt ()
Briefly:Gets a set of interface options.#include int PASCAL FAR getsockopt (SOCKET s, int level, int optname,Char far* optval, int far* optlen);S: A descriptive word that identifies the socket interface.Level: The
Socket
Programming in Windows
When you are familiar with network programming in the UnixEnvironment, understanding Windows Network Programming is easy. This sectionDescribes the relationship between the windows network programming interface andThe
1.1 file descriptorThe file descriptor (fd) is equivalent to the file handle in windows programming. It enables a non-negative integer to reference an open file.In Unix, the file descriptor 0 (STDIN_FILENO) is the standard output, 1 (STDOUT_FILENO)
VII. Data ManagementMemory managementMalloc,free,realloc and windows are the same, both ANSI C.In fact, the application does not have direct access to physical memory, or it can obtain much larger memory space than actual memory through malloc,
This topic is circulated on the Internet in the same version, that is, the first item is the difference between header files, but the header files listed later are only # include (it is estimated that some people accidentally forgot to escape the
Note the following when porting socket-related programs from windows to Linux:
1) header fileWinsock. h/winsock2.h in WindowsSys/socket. h in LinuxError Handling: errno. h
2) initializationWsastartup and wsacleanup are required for Windows.Not
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.