fcntl

Learn about fcntl, we have the largest and most updated fcntl information on alibabacloud.com

Epool Detailed use instructions

EPOLL-I/O Event Notification Facility In Linux network programming, it is a long time to use Select to do event triggering. In the new Linux kernel, there is a mechanism to replace it, which is epoll. The biggest advantage over Select,epoll is

Recommended Locks and mandatory locks

FCNTL has a powerful capability to copy an existing descriptor, get/Set file descriptor tags, get/Set file status tags, get/Set asynchronous I/O ownership, get/set record locks. When multiple users work together to manipulate a file, Linux usually

AIX poll TCP

AIX supports poll, tests it, and matches expectations. Server #include #include #include #include #include #include #include /*Pollin Date can be readPollrdnorm Date can be read Pollrdband Priority date can be read Pollpri Urgent date can be

Build a backend server: service-side code (asynchronous, large concurrency)

#include #include #include #include #include #include 07.#ifndef WIN32#include #include #include #include #include #include #else#include #define CLOSE (f) closesocket (f)#endif19.20.struct my_event_s21.{int FD;-Char recv[64];Char send[64];25.-int

Using Select to implement timeout processing in Connect

reprint: Use Select to implement timeout processing in ConnectIn the general case of blocking sockets, connect () is not returned until the client's ACK message arrives for the SYN message. One way to make the Connect () call with a timeout

Improve Linux connection restrictions

Improve Linux connection restrictions-Linux Enterprise Application-Linux server application information. For more information, see the following section. In linux, TCP connections are limited to TD_SETSIZE. The default value is 1024, which is

Sniffer detection tool

/*Gcc-lbsd-O3-O linuxanti. c*//*Network promiscuous Ethernet detector.Linux 2.0.x/2.1.x, libc5 & glibc-----------------------------------------(C) 1998 savage@apostols.org-----------------------------------------Scan your subnet, and detect

Non-blocking Socket Connection

Solution 1: Int connect_socket_timeout (INT sockfd, char * dest_host, int port, int timeout) { Struct sockaddr_in address; Struct in_addr inaddr; Struct hostent * Host; Int err, Noblock = 1, connect_ OK = 0, begin_time = Time (null ); Log_debug

Linux programming process (III): exec functions and system functions

1. Exec replacement process image On Process Creation, Unix adopts a unique method, which separates Process Creation from loading a new process image. The advantage is that there is more room to manage the two operations. After we create a process,

How to drive asynchronous notification applications in Linux

The driver runs in the kernel space, and the application runs in the user space. The two cannot communicate directly. However, in actual application, when the device is ready, we want to notify the user that the program device is OK, The user

Nonblock I/O and Its Usage

This is a very interesting topic, and this stuff affects the interaction between kernel/driver and application. First, let's talk about this concept. When the application is blocked, the program enters the sleep state. Possible blocks are: 1. Open 2.

UDP socket uses signal-driven I/O

The essence of signal-driven I/O is that the process informs the kernel in advance that when a descriptor event occurs, the kernel will send a sigio signal to the process, and the process can be processed in the signal processing function. The

Server programming example

Int fd_set_nonblock (int fd) { Int RV; Rv = fcntl (FD, f_getfl, 0 ); If (RV Printf ("fcntl error \ n "); Return-1; } Rv = fcntl (FD, f_setfl, RV | o_nonblock ); If (RV Printf ("fcntl error \ n "); Return-1; } Return 0; } Int init_server_socket ()

Linux Kernel ioctl function learning

From: http://bbs.chinaunix.net/forum.php? MoD = viewthread & tid = 1967512. Detailed description of ioctl function parametersIoctl functionThis function affects an open file referenced by the FD parameter.# IncludeInt IOCTL (int fd, int request,.../

Epoll Study Notes

Epoll Study NotesEpoll has two modes: edge triggered (ET) and level triggered (LT ). when using the two modes, note that if the et mode is used, the notification will only be sent when the status changes. The lt mode is similar to the original

Uart1 read/write Program

# Include # Include # Include # Include # Include # Include # Include # Include # Include Int set_opt (int fd, int nSpeed, int nBits, char nEvent, int nStop){Struct termios newtio, oldtio; If (tcgetattr (fd, & oldtio )! = 0){Perror ("setup serial 1

Multithreading of SQLite

Is SQLite thread-safe? Sometimes yes. To ensure thread security, SQLite must set the threadsafe preprocessing macro to 1 during compilation. In the default released compiled version, Windows is thread-safe, but Linux is not. If thread security is

[Accumulate by bit] Use Vim (1) (fromqq)

Source: success, 1) the view of all windows is saved in the session information, and global settings are added. 2) The viminfo information contains the command line history, search string history, input line history, and non-empty register content),

Unix file I/O

1 Common I/O Open a fileInt open (const char * pathname, int flags); int open (const char * pathname, int flags, mode_t mode); Return Value: file descriptor, an integer. Header file: # include # include # include first parameter: Path of the file

FAQ Chinese Version

FAQ Chinese Version How do I create an auto-increment field? What data types does SQLite support? Why can I insert a string into an integer field of the SQLite database? Why does SQLite think the expression '0' = '00' is true? Why

Total Pages: 15 1 .... 10 11 12 13 14 15 Go to: Go

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.