
linux
文章平均质量分 88
u010765526
这个作者很懒,什么都没留下…
展开
-
头文件unistd.h中的unistd是什么的缩写?
unixstandardheader -> unistd.hstandardinputoutputheader -> stdio.hstandardlibraryheader -> stdlib.h原创 2020-06-19 17:00:54 · 1346 阅读 · 0 评论 -
__attribute__中constructor和destructor
1,__attribute__介绍__attribute__可以设置函数属性(Function Attribute)、变量属性(Variable Attribute)和类型属性(Type Attribute)。__attribute__前后都有两个下划线,并且后面会紧跟一对原括弧,括弧里面是相应的__attribute__参数 __attribute__语法格式为:__attrib...原创 2020-05-05 21:47:42 · 156 阅读 · 0 评论 -
程序结束后,malloc申请的内存会被释放掉吗
1,有这么一个问题,下面这段程序执行完毕后,malloc的内存会释放吗?int main () { int *p = malloc(10 * sizeof *p); *p = 42; return 0; //Exiting without freeing the allocated memory} 这段程序运行完后,p 申请的malloc地址会被释放掉吗? 会的。T...原创 2020-02-24 21:45:57 · 8792 阅读 · 1 评论 -
linux 文件描述符与文件指针 详解
简单归纳:fd只是一个整数,在open时产生。起到一个索引的作用,进程通过PCB中的文件描述符表找到该fd所指向的文件指针file。1,文件描述符 文件描述符的操作(如: open)返回的是一个文件描述符,内核会在每个进程空间中维护一个文件描述符表, 所有打开的文件都将通过此表中的文件描述符来引用;而流(如: fopen)返回的是一个FILE结构指针, FILE结构是包含有文件...原创 2020-02-23 23:06:28 · 371 阅读 · 0 评论 -
linux内核源码下载地址
从linux0.0.1到现在,可下载不同时期的linux 内核版本:http://ftp.sjtu.edu.cn/sites/ftp.kernel.org/pub/linux/kernel/原创 2019-05-12 11:12:44 · 5403 阅读 · 0 评论 -
unix/Linux BSD以及System V---认知
一,BSD 和System V Unix操作系统在操作风格上主要分为System V和BSD(目前一般采用BSD的第4个版本SVR4),前者的代表的操作系统有Solaris操作系统,在Solaris1.X之前,Solaris采用的是BSD风格,2.x之后才投奔System V阵营。后者的代表的操作系统有FreeBSD。 System V它最初由AT&T开发,曾经也被...原创 2019-05-01 14:59:51 · 604 阅读 · 0 评论 -
linux fork
1,fork函数#include <unistd.h>pid_t fork(void); 返回值:子进程返回0,父进程中返回子进程id,出错返回-1 由fork创建的新进程被称为子进程。fork函数被调用一次,但返回两次。两次返回的唯一区别是子进程的返回值是0,而父进程的返回值则是新子进程的进程id。 为什么...原创 2019-05-04 17:02:25 · 292 阅读 · 0 评论 -
ENOENT
Why does ENOENT mean “No such file or directory”?It's an abbreviation(缩写)of Error NO ENTry (or Error NO ENTity), and can actually be used for more than files/directories.It's simply “No such d...原创 2019-05-02 16:25:25 · 1420 阅读 · 0 评论 -
isystem v ipc 之键,标识符和ftok详解
1,system v ipc的三种方式system v 消息队列 system v 信号量 system v 共享内存 消息队列 信号量 共享内存 头文件 <sys/msg.h> <sys/sem.h> <sys/shm.h> 创建或打开ipc的函数 msgget semget shmge...原创 2019-05-01 21:19:19 · 492 阅读 · 0 评论 -
linux fork的那些事
1,fork引发的悬案原创 2019-04-08 23:21:00 · 133 阅读 · 0 评论 -
linux stat函数
linuxC函数之stat函数1.函数功能:通过文件名filename获取文件信息,并保存在buf所指的结构体stat中2.函数原型1)函数头文件 [cpp] view plain copy#include <sys/stat.h> #include <unistd.h> 2)函数[cpp] view plain ...原创 2017-06-22 08:32:58 · 335 阅读 · 0 评论