403Webshell
Server IP : 82.208.35.60  /  Your IP : 216.73.216.168
Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31
System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64
User : studiokobylisy_cz ( 1008)
PHP Version : 7.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/ports/sysutils/fusefs-libs3/work/fuse-3.12.0/example/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/ports/sysutils/fusefs-libs3/work/fuse-3.12.0/example/poll_client.c
/*
  FUSE fselclient: FUSE select example client
  Copyright (C) 2008       SUSE Linux Products GmbH
  Copyright (C) 2008       Tejun Heo <teheo@suse.de>

  This program can be distributed under the terms of the GNU GPLv2.
  See the file COPYING.
*/

/** @file
 *
 * This program tests the poll.c example file systsem.
 *
 * Compile with:
 *
 *      gcc -Wall poll_client.c -o poll_client
 *
 * ## Source code ##
 * \include poll_client.c
 */

#include <config.h>

#include <sys/select.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>

#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");
	}
	return 0;
}

Youez - 2016 - github.com/yon3zu
LinuXploit