zoukankan      html  css  js  c++  java
  • 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) 

  • 相关阅读:
    vSphere笔记01~02
    【科普】人眼到底等于多少像素
    《标题党》自我修炼的10个秘籍
    说说云盘背后的黑科技!
    用shell批量编码转换
    Java课设--俄罗斯方块Tetris
    教程,Python图片转字符堆叠图
    谈谈索引的哲学思想
    MySQL索引实战经验总结
    博客要转型啦
  • 原文地址:https://www.cnblogs.com/xpylovely/p/10916085.html
Copyright © 2011-2022 走看看