mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-01-31 11:37:35 +00:00
00611e9b06
The ZIP filesystem has a breaking change. You now need to use /zip/ to open() / opendir() / etc. assets within the ZIP structure of your APE binary, instead of the previous convention of using zip: or zip! URIs. This is needed because Python likes to use absolute paths, and having ZIP paths encoded like URIs simply broke too many things. Many more system calls have been updated to be able to operate on ZIP files and file descriptors. In particular fcntl() and ioctl() since Python would do things like ask if a ZIP file is a terminal and get confused when the old implementation mistakenly said yes, because the fastest way to guarantee native file descriptors is to dup(2). This change also improves the async signal safety of zipos and ensures it doesn't maintain any open file descriptors beyond that which the user has opened. This change makes a lot of progress towards adding magic numbers that are specific to platforms other than Linux. The philosophy here is that, if you use an operating system like FreeBSD, then you should be able to take advantage of FreeBSD exclusive features, even if we don't polyfill them on other platforms. For example, you can now open() a file with the O_VERIFY flag. If your program runs on other platforms, then Cosmo will automatically set O_VERIFY to zero. This lets you safely use it without the need for #ifdef or ifstatements which detract from readability. One of the blindspots of the ASAN memory hardening we use to offer Rust like assurances has always been that memory passed to the kernel via system calls (e.g. writev) can't be checked automatically since the kernel wasn't built with MODE=asan. This change makes more progress ensuring that each system call will verify the soundness of memory before it's passed to the kernel. The code for doing these checks is fast, particularly for buffers, where it can verify 64 bytes a cycle. - Correct O_LOOP definition on NT - Introduce program_executable_name - Add ASAN guards to more system calls - Improve termios compatibility with BSDs - Fix bug in Windows auxiliary value encoding - Add BSD and XNU specific errnos and open flags - Add check to ensure build doesn't talk to internet
45 lines
1.6 KiB
C
45 lines
1.6 KiB
C
#ifndef COSMOPOLITAN_LIBC_NT_ENUM_FILEFLAGANDATTRIBUTES_H_
|
|
#define COSMOPOLITAN_LIBC_NT_ENUM_FILEFLAGANDATTRIBUTES_H_
|
|
|
|
/**
|
|
* MS-DOS File Attributes.
|
|
*
|
|
* @see GetFileInformationByHandle()
|
|
* @see libc/sysv/consts.sh
|
|
*/
|
|
#define kNtFileAttributeReadonly 0x00000001u
|
|
#define kNtFileAttributeHidden 0x00000002u
|
|
#define kNtFileAttributeSystem 0x00000004u
|
|
#define kNtFileAttributeVolumelabel 0x00000008u
|
|
#define kNtFileAttributeDirectory 0x00000010u
|
|
#define kNtFileAttributeArchive 0x00000020u
|
|
|
|
/**
|
|
* NT File Attributes.
|
|
*/
|
|
#define kNtFileAttributeDevice 0x00000040u
|
|
#define kNtFileAttributeNormal 0x00000080u
|
|
#define kNtFileAttributeTemporary 0x00000100u
|
|
#define kNtFileAttributeSparseFile 0x00000200u
|
|
#define kNtFileAttributeReparsePoint 0x00000400u
|
|
#define kNtFileAttributeCompressed 0x00000800u
|
|
#define kNtFileAttributeOffline 0x00001000u
|
|
#define kNtFileAttributeNotContentIndexed 0x00002000u
|
|
#define kNtFileAttributeEncrypted 0x00004000u
|
|
|
|
/**
|
|
* NT File Flags.
|
|
*/
|
|
#define kNtFileFlagWriteThrough 0x80000000u
|
|
#define kNtFileFlagOverlapped 0x40000000u
|
|
#define kNtFileFlagNoBuffering 0x20000000u
|
|
#define kNtFileFlagRandomAccess 0x10000000u
|
|
#define kNtFileFlagSequentialScan 0x08000000u
|
|
#define kNtFileFlagDeleteOnClose 0x04000000u
|
|
#define kNtFileFlagBackupSemantics 0x02000000u
|
|
#define kNtFileFlagPosixSemantics 0x01000000u
|
|
#define kNtFileFlagOpenReparsePoint 0x00200000u
|
|
#define kNtFileFlagOpenNoRecall 0x00100000u
|
|
#define kNtFileFlagFirstPipeInstance 0x00080000u
|
|
|
|
#endif /* COSMOPOLITAN_LIBC_NT_ENUM_FILEFLAGANDATTRIBUTES_H_ */
|