zoukankan      html  css  js  c++  java
  • openat

    阅读android的init代码中uevent部分时,发现openat系统调用。小记一下:


           #include <fcntl.h>

           int openat(int dirfd, const char *pathname, int flags);
           int openat(int dirfd, const char *pathname, int flags, mode_t mode);


    openat系统调用与open功能类似,但用法上有以下不同:

    1. 如果pathname是相对地址,以dirfd作为相对地址寻址目录。而open是从当前目录开始寻址的。

    2. 如果pathname是相对地址,且dirfd的值是AT_FDCWD,则openat的行为与open一样,从当前目录开始相对寻址。

    3. 如果pathname是绝对地址,则dirfd参数不起作用。


    成功返回新的文件描述符,出错返回-1。

  • 相关阅读:
    Redis篇
    MySql篇
    Tomcat篇
    JDK篇
    冒泡排序(算法源码)
    堆排序(源码)
    快速排序(递归及非递归算法源码)
    MongoDB 复制
    MongoDB appendix
    服务器端脚本
  • 原文地址:https://www.cnblogs.com/sammei/p/3295604.html
Copyright © 2011-2022 走看看