From bcad1a6f22662ff0d04a6ae417adb30550252d97 Mon Sep 17 00:00:00 2001 From: Nikolaus Rath Date: Sun, 9 Oct 2016 19:50:51 -0700 Subject: Renamed ioctl and poll examples The new names should make it more obvious at first glance what each example demonstrates. --- example/fselclient.c | 86 ---------------------------------------------------- 1 file changed, 86 deletions(-) delete mode 100644 example/fselclient.c (limited to 'example/fselclient.c') diff --git a/example/fselclient.c b/example/fselclient.c deleted file mode 100644 index 637cb07..0000000 --- a/example/fselclient.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - FUSE fselclient: FUSE select example client - Copyright (C) 2008 SUSE Linux Products GmbH - Copyright (C) 2008 Tejun Heo - - This program can be distributed under the terms of the GNU GPL. - See the file COPYING. - -*/ - -/** @file - * @tableofcontents - * - * fselclient.c - FUSE fselclient: FUSE select example client - * - * \section section_compile compiling this example - * - * gcc -Wall fselclient.c -o fselclient - * - * \section section_source the complete source - * \include fselclient.c - */ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define FSEL_FILES 16 - -int main(void) -{ - static const char hex_map[FSEL_FILES] = "0123456789ABCDEF"; - int fds[FSEL_FILES]; - int i, nfds, tries; - - for (i = 0; i < FSEL_FILES; i++) { - char name[] = { hex_map[i], '\0' }; - fds[i] = open(name, O_RDONLY); - if (fds[i] < 0) { - perror("open"); - return 1; - } - } - nfds = fds[FSEL_FILES - 1] + 1; - - for(tries=0; tries < 16; tries++) { - static char buf[4096]; - fd_set rfds; - int rc; - - FD_ZERO(&rfds); - for (i = 0; i < FSEL_FILES; i++) - FD_SET(fds[i], &rfds); - - rc = select(nfds, &rfds, NULL, NULL, NULL); - - if (rc < 0) { - perror("select"); - return 1; - } - - for (i = 0; i < FSEL_FILES; i++) { - if (!FD_ISSET(fds[i], &rfds)) { - printf("_: "); - continue; - } - printf("%X:", i); - rc = read(fds[i], buf, sizeof(buf)); - if (rc < 0) { - perror("read"); - return 1; - } - printf("%02d ", rc); - } - printf("\n"); - } -} -- cgit v1.2.3