Advanced Linux Programming: 11-A Sample GNU/Linux Application

Tham khảo tài liệu 'advanced linux programming: 11-a sample gnu/linux application', 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ả | A Sample GNU Linux Application This chapter is where it all comes ll describe and implement a complete GNU Linux program that incorporates many of the techniques described in this book. The program provides information about the system it s running on via a Web interface. The program is a complete demonstration of some of the methods we ve described for GNU Linux programming and illustrated in shorter programs. This program is written more like real-world code unlike most of the code listings that we presented in previous chapters. It can serve as a jumping-off point for your own GNU Linux programs. Overview The example program is part of a system for monitoring a running GNU Linux system. It includes these features The program incorporates a minimal Web server. Local or remote clients access system information by requesting Web pages from the server via HTTP. The program does not serve static HTML pages. Instead the pages are generated on the fly by modules each of which provides a page summarizing one aspect of the system s state. 220 Chapter 11 A Sample GNU Linux Application Modules are not linked statically into the server executable. Instead they are loaded dynamically from shared libraries. Modules can be added removed or replaced while the server is running. The server services each connection in a child process. This enables the server to remain responsive even when individual requests take a while to complete and it shields the server from failures in modules. The server does not require superuser privilege to run as long as it is not run on a privileged port . However this limits the system information that it can collect. We provide four sample modules that demonstrate how modules might be written. They further illustrate some of the techniques for gathering system information presented previously in this time module demonstrates using the gettirneofday system issue module demonstrates low-level I O and the sendfile .

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.