mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-02 17:28:30 +00:00
Make fixes and improvements
- Fix handling of precision in hex float formatting - Enhance the cocmd interpreter for system() and popen() - Manually ran the Lua unit tests, which are now passing - Let stdio i/o operations happen when file is in error state - We're now saving and restoring xmm in ftrace out of paranoia
This commit is contained in:
parent
95fbdb4f76
commit
41396ff48a
43 changed files with 495 additions and 261 deletions
90
libc/stdio/ftw.h
Normal file
90
libc/stdio/ftw.h
Normal file
|
@ -0,0 +1,90 @@
|
|||
#ifndef COSMOPOLITAN_THIRD_PARTY_MUSL_FTW_H_
|
||||
#define COSMOPOLITAN_THIRD_PARTY_MUSL_FTW_H_
|
||||
#include "libc/calls/struct/stat.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
/**
|
||||
* Type for file.
|
||||
*/
|
||||
#define FTW_F 1
|
||||
|
||||
/**
|
||||
* Type for directory.
|
||||
*/
|
||||
#define FTW_D 2
|
||||
|
||||
/**
|
||||
* Type for directory that cannot be read.
|
||||
*/
|
||||
#define FTW_DNR 3
|
||||
|
||||
/**
|
||||
* Type for stat() failed and not a symbolic link.
|
||||
*/
|
||||
#define FTW_NS 4
|
||||
|
||||
/**
|
||||
* Type for symbolic link when `FTW_PHYS` is in flags.
|
||||
*/
|
||||
#define FTW_SL 5
|
||||
|
||||
/**
|
||||
* Directory and `FTW_DEPTH` in flags.
|
||||
*/
|
||||
#define FTW_DP 6
|
||||
|
||||
/**
|
||||
* Type for broken symbolic link when `FTW_PHYS` is not in flags.
|
||||
*/
|
||||
#define FTW_SLN 7
|
||||
|
||||
/**
|
||||
* Flag to prevent following symbolic links (recommended).
|
||||
* @see nftw() flags
|
||||
*/
|
||||
#define FTW_PHYS 1
|
||||
|
||||
/**
|
||||
* Flag to prevent crossing mount points.
|
||||
* @see nftw() flags
|
||||
*/
|
||||
#define FTW_MOUNT 2
|
||||
|
||||
/**
|
||||
* Unsupported.
|
||||
* @see nftw() flags
|
||||
*/
|
||||
#define FTW_CHDIR 4
|
||||
|
||||
/**
|
||||
* Flag for post-order traversal.
|
||||
*
|
||||
* 1. Will use `FTW_DP` instead of `FTW_D` as type.
|
||||
* 2. Directory callback happens *after* rather than before.
|
||||
*
|
||||
* @see nftw() flags
|
||||
*/
|
||||
#define FTW_DEPTH 8
|
||||
|
||||
struct FTW {
|
||||
|
||||
/**
|
||||
* Byte offset of basename component in `fpath` passed to callback.
|
||||
*/
|
||||
int base;
|
||||
|
||||
/**
|
||||
* Depth relative to `dirpath` whose level is zero.
|
||||
*/
|
||||
int level;
|
||||
};
|
||||
|
||||
int ftw(const char *, int (*)(const char *, const struct stat *, int), int);
|
||||
int nftw(const char *,
|
||||
int (*)(const char *, const struct stat *, int, struct FTW *), int,
|
||||
int);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_THIRD_PARTY_MUSL_FTW_H_ */
|
Loading…
Add table
Add a link
Reference in a new issue