Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
file.h
Package: linux-2.4.20.tar.gz [view]
Upload User: jlfgdled
Upload Date: 2013-04-10
Package Size: 33168k
Code Size: 2k
Category:
Linux-Unix program
Development Platform:
Unix_Linux
- /*
- * Wrapper functions for accessing the file_struct fd array.
- */
- #ifndef __LINUX_FILE_H
- #define __LINUX_FILE_H
- extern void FASTCALL(fput(struct file *));
- extern struct file * FASTCALL(fget(unsigned int fd));
- static inline int get_close_on_exec(unsigned int fd)
- {
- struct files_struct *files = current->files;
- int res;
- read_lock(&files->file_lock);
- res = FD_ISSET(fd, files->close_on_exec);
- read_unlock(&files->file_lock);
- return res;
- }
- static inline void set_close_on_exec(unsigned int fd, int flag)
- {
- struct files_struct *files = current->files;
- write_lock(&files->file_lock);
- if (flag)
- FD_SET(fd, files->close_on_exec);
- else
- FD_CLR(fd, files->close_on_exec);
- write_unlock(&files->file_lock);
- }
- static inline struct file * fcheck_files(struct files_struct *files, unsigned int fd)
- {
- struct file * file = NULL;
- if (fd < files->max_fds)
- file = files->fd[fd];
- return file;
- }
- /*
- * Check whether the specified fd has an open file.
- */
- static inline struct file * fcheck(unsigned int fd)
- {
- struct file * file = NULL;
- struct files_struct *files = current->files;
- if (fd < files->max_fds)
- file = files->fd[fd];
- return file;
- }
- extern void put_filp(struct file *);
- extern int get_unused_fd(void);
- static inline void __put_unused_fd(struct files_struct *files, unsigned int fd)
- {
- FD_CLR(fd, files->open_fds);
- if (fd < files->next_fd)
- files->next_fd = fd;
- }
- static inline void put_unused_fd(unsigned int fd)
- {
- struct files_struct *files = current->files;
- write_lock(&files->file_lock);
- __put_unused_fd(files, fd);
- write_unlock(&files->file_lock);
- }
- void fd_install(unsigned int fd, struct file * file);
- void put_files_struct(struct files_struct *fs);
- #endif /* __LINUX_FILE_H */