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