Home | History | Annotate | Download | only in openat
      1 /*
      2  * Copyright (c) 2014 Fujitsu Ltd.
      3  * Author: Xing Gu <gux.fnst (at) cn.fujitsu.com>
      4  *
      5  * This program is free software; you can redistribute it and/or modify it
      6  * under the terms of version 2 of the GNU General Public License as
      7  * published by the Free Software Foundation.
      8  *
      9  * This program is distributed in the hope that it would be useful, but
     10  * WITHOUT ANY WARRANTY; without even the implied warranty of
     11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     12  *
     13  * You should have received a copy of the GNU General Public License along
     14  * with this program.
     15  */
     16 
     17 #include <stdio.h>
     18 #include <stdlib.h>
     19 #include <string.h>
     20 #include <errno.h>
     21 #include <unistd.h>
     22 
     23 #define STR "abc"
     24 
     25 char *TCID = "openat02_child";
     26 
     27 int main(int argc, char **argv)
     28 {
     29 	int fd;
     30 	int ret;
     31 
     32 	if (argc != 2) {
     33 		fprintf(stderr, "%s <fd>\n", argv[0]);
     34 		exit(1);
     35 	}
     36 
     37 	fd = atoi(argv[1]);
     38 	ret = write(fd, STR, sizeof(STR) - 1);
     39 
     40 	return ret != -1;
     41 }
     42