/* * Copyright (c) 2014 Fujitsu Ltd. * Author: Zeng Linggang * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it would be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * You should have received a copy of the GNU General Public License along * with this program. */ #include #include #include #include #include int main(int argc, char **argv) { int ret; int fd; if (argc != 2) { fprintf(stderr, "Only two arguments: %s \n", argv[0]); exit(1); } fd = atoi(argv[1]); ret = write(fd, argv[1], strlen(argv[1])); return ret != -1; }