Advanced Linux Programming: B Low-Level I/O

Tham khảo tài liệu 'advanced linux programming: b low-level i/o', công nghệ thông tin, hệ điều hành phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Low-Level I O C r . . PROGRAMMERS ON GNU LINUX HAVE TWO SETS OF INPUT OUTPUT functions at their standard C library provides I O functions printf fopen and so The Linux kernel itself provides another set of I O operations that operate at a lower level than the C library functions. Because this book is for people who already know the C language we ll assume that you have encountered and know how to use the C library I O functions. Often there are good reasons to use Linux s low-level I O functions. Many of these are kernel system calls2 and provide the most direct access to underlying system capabilities that is available to application programs. In fact the standard C library I O routines are implemented on top of the Linux low-level I O system calls. Using the latter is usually the most efficient way to perform input and output operations and is sometimes more convenient too. 1. The C standard library provides iostreams with similar standard C library is also available in the C language. 2. See Chapter 8 Linux System Calls for an explanation of the difference between a system call and an ordinary function call. 282 Appendix B Low-Level I O Throughout this book we assume that you re familiar with the calls described in this may already be familiar with them because they re nearly the same as those provided on other UNIX and UNIX-like operating systems and on the Win32 platform as well . If you re not familiar with them however read on you ll find the rest of the book much easier to understand if you familiarize yourself with this material first. Reading and Writing Data The first I O function you likely encountered when you first learned the C language was formats a text string and then prints it to standard generalized version fprintf can print the text to a stream other than standard output. A stream is represented by a FILE obtain a FILE pointer by opening a file with fopen. .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.