IT222, 1-2 WS... SLU Baguio City Philippines
Comparison between WIN32 API and POSIX API
Win32 API is Microsoft’s core set of application programming interfaces available in the Microsoft Windows operating systems while POSIX API, an acronym for “Portable Operating System Interface (for Unix)” is a core set of application programming interfaces, shell, and utilities interfaces for software compatible with variants on the Unix operating system. Each of which has its own style of implementation.
Win32 and POSIX API have processes that needed several resources to execute, and if resources are available, they can be granted and control can be returned to the user process. Otherwise, the process will have to wait until sufficient resources are available. This various resources controlled by the operating system can be thought of as devices, thus device management and control is needed to be implemented in both Win32 and POSIX API. It does more on sending request codes which are device specific to perform device-specific operations. In POSIX API, “ioctl” system call is used, supporting by most Unix and Unix-like systems, while in Win32 API, it is named as “DeviceIoControl”, which sends a control code directly of a specified device driver, causing the corresponding device to perform the corresponding operation. When it comes to Implementation, POSIX “ioctl” call takes as parameters an open file descriptor; a request code number; or either an integer value, possibly unsigned (going to the driver) or a pointer to data (either goint to the driver, coming back from the driver, or both). A Win32 DeviceIoControl takes as parameters an object handle (the Win32 equivalent of a file descriptor); a request code number (the “control code”); a buffer for input parameters; length of the input buffer; a buffer for output results, length of the output buffer; and an OVERLAPPED structure, if overlapped I/O is being used. The Win32 device...