
linux库函数
发如雪Jay
你猜
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
linux系统中open函数的使用
linux系统中open函数的使用原型://参数1是路径(文件名),参数2是读写权限:O_RDONLY是只读,O_WRONLY是只写,O_RDWR是读写 int open(const char *pathname, int flags); //参数1是路径(文件名),参数2是读写权限,参数3是文件权限 int open(const char *pathname, int flags, mode_t mode);具体使用见代码myopen.c,代码中有注释//open的头文件#include原创 2021-07-18 10:58:23 · 697 阅读 · 0 评论 -
linux系统中read函数与write函数的使用
linux系统中read函数与write函数read函数原型ssize_t read(int fd, void *buf, size_t count);write函数原型ssize_t write(int fd, const void *buf, size_t count);具体使用见代码read_write.c#include <stdio.h>#include <stdlib.h>#include <sys/types.h>#include &l原创 2021-07-18 11:03:34 · 295 阅读 · 0 评论 -
linux中lseek函数使用
linux中lseek函数函数原型off_t lseek(int fd, off_t offset, int whence);具体使用见代码lseek.c#include <unistd.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <stdio.h>#include <stdlib.h>int main(){原创 2021-07-18 11:08:10 · 1539 阅读 · 0 评论 -
linux中fcntl函数的使用
linux中fcntl函数函数原型:int fcntl(int fd, int cmd, ... /* arg */ );代码:#include <stdio.h>#include <stdlib.h>#include <fcntl.h>#include <unistd.h>#include <string.h>int main(){ int fd; int flag; //测试字符串 char* p = "中国是一原创 2021-07-18 11:11:30 · 298 阅读 · 0 评论