码迷,mamicode.com
首页 >  
搜索关键字:fcntl    ( 291个结果
aaa
#include <stdio.h>#include <string.h>#include <iostream>#include <sys/socket.h>#include <netdb.h>#include <fcntl.h>static int setSocketNonBlock(const
分类:其他好文   时间:2016-02-03 17:23:17    阅读次数:193
epoll案例
#include <stdio.h>#include <string.h>#include <iostream>#include <fcntl.h>#include <sys/socket.h>#include <netdb.h>#include <netinet/in.h>#include <ar
分类:其他好文   时间:2016-02-03 00:11:42    阅读次数:198
linux实现针对文本统计字母出现的次数(所有的可打印的字符)
最近在看看有意思的编程,发现算法真是一个好东西,呵呵,自己也写了一个简单的demo 代码具体如下: #include <stdio.h> #include <string.h> #include <unistd.h> #include <stdint.h> #include <fcntl.h> #i
分类:系统相关   时间:2016-01-27 17:18:27    阅读次数:233
fcntl系统调用
fcntl系统调用
分类:其他好文   时间:2016-01-11 21:56:56    阅读次数:222
[APUE]不用fcntl实现dup2函数功能
dup2的函数定义为:#include int dup2(int src_fd, int new_fd);自己实现dup2函数有几个关键点:1,检查给定的源fd是否有效,且都大于0,2,检查目标fd是否超出了系统设定的范围,而这个值在书上是没有着重指出的, 比如mac限制了要小于256,ubunt....
分类:其他好文   时间:2015-12-23 00:38:18    阅读次数:361
fcntl()功能 详解
fcntl()函数可以改变已打开文件的性质 #include #include int fcntl(int fd , int cmd); int fcntl(int fd, int cmd, long arg); int fcntl(int fd, int cmd, struct ...
分类:其他好文   时间:2015-11-21 18:12:11    阅读次数:188
第十周学习总结
代码的理解。Who1.c#include //标准输入输出#include//C标准函数库#include #include //定义了很多宏和open,fcntl函数原型#include //Unix类系统定义符号常量#define SHOWHOSTintshow_info(structutmp*...
分类:其他好文   时间:2015-11-15 20:46:37    阅读次数:203
字符设备之异步信号通知
应用程序注册信号处理函数 my_signal_fun();应用程序获取应用PID并告诉驱动 fcntl(fd, F_SETOWN, getpid()); int oflags = fcntl(fd, F_GETFL); fcntl(fd, F_SETFL, oflags|FASYNC);由驱...
分类:其他好文   时间:2015-10-08 16:13:26    阅读次数:172
Python中给文件加锁
首先要引入库import fcntl打开一个文件f = open('./test')对该文件加密:fcntl.flock(f, fcntl.LOCK_EX)这样就对文件test加锁了,如果有其他进程要对test进行加锁,则不能成功,会被阻塞,但不会退出程序。解锁:fcntl.flock(f,fcnt...
分类:编程语言   时间:2015-09-30 12:41:08    阅读次数:208
Linux文件I/O编程(二)lseek函数
文件I/O编程处理open、read、write、close,等必要函数对文件进行读写操作外,lseek、fcntl也是I/O编程很重要的函数。lseek函数lseek函数主要用来移动当前读写位置,第一个参数是文件描述符fd,第二个参数是偏移距离,第三个参数是文件内容指针宏,分别有SEEK_SET(文件头),SE..
分类:系统相关   时间:2015-09-27 06:32:38    阅读次数:204
291条   上一页 1 ... 18 19 20 21 22 ... 30 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!