From: wzdftpd <tr...@wz...> - 2008-03-20 06:46:42
|
#153: Remove use of primative unistd.h IO and use ISO C99 compliant functions instead -------------------------+-------------------------------------------------- Reporter: virdiq | Owner: anonymous Type: enhancement | Status: new Priority: normal | Milestone: Component: server core | Version: Severity: minor | Keywords: -------------------------+-------------------------------------------------- Primitive IO functions defined in unistd.h such as write() and read() are deprecated in the current ISO C99 standards. We should be using fwrite() and fread() as more-or-less direct replacements or better yet, convert code to use the abstracted file system layer of wzd_file.c This means that we will no longer need fd_t (it is not mentioned once in the ISO C99 standard). If using fwrite() and fread(), we use FILE instead of fd_t. -- Ticket URL: <https://www.wzdftpd.net/trac/ticket/153> wzdftpd <http://www.wzdftpd.net/> wzdftpd |
From: wzdftpd <tr...@wz...> - 2008-03-20 07:25:02
|
#153: Remove use of primative unistd.h IO and use ISO C99 compliant functions instead -------------------------+-------------------------------------------------- Reporter: virdiq | Owner: anonymous Type: enhancement | Status: new Priority: normal | Milestone: Component: server core | Version: Severity: minor | Resolution: Keywords: | -------------------------+-------------------------------------------------- Comment (by virdiq): See this page: http://www.cs.utk.edu/~plank/plank/classes/cs360/360/notes/Cat/lecture.html For more information on the performance differences of each method for reading and writing files. If we can abstract things into wzd_file.c that allows us to use even more efficient mechanisms such as POSIX AIO, native Windows API, etc whenever called for. -- Ticket URL: <https://www.wzdftpd.net/trac/ticket/153#comment:1> wzdftpd <http://www.wzdftpd.net/> wzdftpd |
From: wzdftpd <tr...@wz...> - 2008-03-20 08:27:46
|
#153: Remove use of primative unistd.h IO and use ISO C99 compliant functions instead -------------------------+-------------------------------------------------- Reporter: virdiq | Owner: anonymous Type: enhancement | Status: new Priority: normal | Milestone: Component: server core | Version: Severity: minor | Resolution: Keywords: | -------------------------+-------------------------------------------------- Comment (by pollux): I agree on the abstraction, but not on the fwrite part .. I really would prefer to avoid FILE* here, and keep using the POSIX functions (which will allow Asynchronous IO, use of select/poll/etc.) -- Ticket URL: <https://www.wzdftpd.net/trac/ticket/153#comment:2> wzdftpd <http://www.wzdftpd.net/> wzdftpd |
From: wzdftpd <tr...@wz...> - 2008-03-20 17:57:35
|
#153: Remove use of primative unistd.h IO and use ISO C99 compliant functions instead -------------------------+-------------------------------------------------- Reporter: virdiq | Owner: anonymous Type: enhancement | Status: new Priority: normal | Milestone: Component: server core | Version: Severity: minor | Resolution: Keywords: | -------------------------+-------------------------------------------------- Comment (by virdiq): Well properly using an abstraction layer is my #1 option as well. But I thought that with FILE*/fwrite/fread being C99 standard... it'd also be the best "fallback" option when the arch doesn't have better arch-specific filesystem functions. It'd work on Windows, Linux and most other architectures without any hassles as it is in the C99 standard. Of course, where an operating system like Linux supports AIO, we would want to use that instead to try and enforce strict zero-copying of data. -- Ticket URL: <https://www.wzdftpd.net/trac/ticket/153#comment:3> wzdftpd <http://www.wzdftpd.net/> wzdftpd |