代码
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
const char *pathname = "./test.conf";
int fd = open(pathname, O_RDWR, S_IRWXU);
if(fd == -1