01

accept(2) pass

accept4(2)// 不会

#define _GNU_SOURCE /* See feature_test_macros(7) */
#include <sys/socket.h>

int accept4(int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags);

如果flag为0相当于accept,flag可以按位或

flag:

SOCK_NONBLOCK:

Set the O_NONBLOCK file status flag on the new open
file description. Using this flag saves extra calls
to fcntl(2) to achieve the same result.

SOCK_CLOEXEC:

Set the close-on-exec (FD_CLOEXEC) flag on the new
file descriptor. See the description of the O_CLOEXEC
flag in open(2) for reasons why this may be useful.

access(2) 

#include <unistd.h>

int access(const char *pathname, int mode);

参数:mode

F_OK:文件是否存在 可以按位or

R_OK:是否可读

W_OK:可写

X_OK:可执行

返回值:0成功,-1失败errno is set appropriately.

---------------------------------------------------------------------------------------------------
acct(2)   sysctl(8) acct(5)//模糊

功能:acct系统调用可用于启动/禁止进程信息记录功能。

struct acct_v3 {
char ac_flag; /* Flags */
char ac_version; /* Always set to ACCT_VERSION (3) */
u_int16_t ac_tty; /* Controlling terminal */
u_int32_t ac_exitcode; /* Process termination status */
u_int32_t ac_uid; /* Real user ID */
u_int32_t ac_gid; /* Real group ID */
u_int32_t ac_pid; /* Process ID */
u_int32_t ac_ppid; /* Parent process ID */
u_int32_t ac_btime; /* Process creation time */
float ac_etime; /* Elapsed time */
comp_t ac_utime; /* User CPU time */
comp_t ac_stime; /* System time */
comp_t ac_mem; /* Average memory usage (kB) */
comp_t ac_io; /* Characters transferred (unused) */
comp_t ac_rw; /* Blocks read or written
(unused) */
comp_t ac_minflt; /* Minor page faults */
comp_t ac_majflt; /* Major page faults */
comp_t ac_swaps; /* Number of swaps (unused) */
char ac_comm[ACCT_COMM]; /* Command name */
};


add_key(2) 
adjtimex(2) 
afs_syscall(2) 
alarm(2) 
alloc_hugepages(2) 
arch_prctl(2) 

posted @   MoonXu  阅读(170)  评论(0编辑  收藏  举报
编辑推荐:
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
阅读排行:
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
点击右上角即可分享
微信分享提示