int _chmod(const char *filename, int func, mode_t mode);
This is a direct connection to the MS-DOS chmod function call, int
0x21, %ax = 0x4300/0x4301. If func is 0, then DOS is called with
AX = 0x4300, which returns an attribute byte of a file. If func
is 1, then the attributes of a file are set as specified in mode.
Note that the directory and volume attribute bits must always be 0 when
_chmod() is called with func = 1, or else the call will fail.
The third argument is optional when getting attributes.
The attribute bits are defined as follows:
....1... Volume Label
xx...... Reserved (used by some network redirectors)
On platforms where the LFN API (see section LFN) is available,
_chmod calls function 0x7143 of Interrupt 21h, to support long
If the file exists,
_chmod() returns its attribute byte in case
it succeded, or -1 in case of failure.