structfile { union { structllist_nodefu_llist; structrcu_headfu_rcuhead; } f_u; structpathf_path; #define f_dentry f_path.dentry structinode *f_inode;/* cached value */ conststructfile_operations *f_op;
/* * Protects f_ep_links, f_flags, f_pos vs i_size in lseek SEEK_CUR. * Must not be taken from IRQ context. */ spinlock_t f_lock; atomic_long_t f_count; unsignedint f_flags; fmode_t f_mode; loff_t f_pos; structfown_structf_owner; conststructcred *f_cred; structfile_ra_statef_ra;
u64 f_version; #ifdef CONFIG_SECURITY void *f_security; #endif /* needed for tty driver, and maybe others */ void *private_data;
#ifdef CONFIG_EPOLL /* Used by fs/eventpoll.c to link all the hooks to this file */ structlist_headf_ep_links; structlist_headf_tfile_llink; #endif/* #ifdef CONFIG_EPOLL */ structaddress_space *f_mapping; #ifdef CONFIG_DEBUG_WRITECOUNT unsignedlong f_mnt_write_state; #endif };
if (bind(pfd.fd, (void *)&nls, sizeof(struct sockaddr_nl))) die("Bind failed\n"); while (-1!=poll(&pfd, 1, -1)) { int i, len = recv(pfd.fd, buf, sizeof(buf), MSG_DONTWAIT); if (len == -1) die("recv\n");
// Print the data to stdout. i = 0; while (i<len) { printf("%s\n", buf+i); i += strlen(buf+i)+1; } } die("poll\n");