mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-28 07:18:30 +00:00
Make improvements
- This change fixes a bug that allowed unbuffered printf() output (to streams like stderr) to be truncated. This regression was introduced some time between now and the last release. - POSIX specifies all functions as thread safe by default. This change works towards cleaning up our use of the @threadsafe / @threadunsafe documentation annotations to reflect that. The goal is (1) to use @threadunsafe to document functions which POSIX say needn't be thread safe, and (2) use @threadsafe to document functions that we chose to implement as thread safe even though POSIX didn't mandate it. - Tidy up the clock_gettime() implementation. We're now trying out a cleaner approach to system call support that aims to maintain the Linux errno convention as long as possible. This also fixes bugs that existed previously, where the vDSO errno wasn't being translated properly. The gettimeofday() system call is now a wrapper for clock_gettime(), which reduces bloat in apps that use both. - The recently-introduced improvements to the execute bit on Windows has had bugs fixed. access(X_OK) on a directory on Windows now succeeds. fstat() will now perform the MZ/#! ReadFile() operation correctly. - Windows.h is no longer included in libc/isystem/, because it confused PCRE's build system into thinking Cosmopolitan is a WIN32 platform. Cosmo's Windows.h polyfill was never even really that good, since it only defines a subset of the subset of WIN32 APIs that Cosmo defines. - The setlongerjmp() / longerjmp() APIs are removed. While they're nice APIs that are superior to the standardized setjmp / longjmp functions, they weren't superior enough to not be dead code in the monorepo. If you use these APIs, please file an issue and they'll be restored. - The .com appending magic has now been removed from APE Loader.
This commit is contained in:
parent
b99512ac58
commit
ff77f2a6af
226 changed files with 708 additions and 2657 deletions
|
@ -513,6 +513,7 @@ static struct dirent *readdir_impl(DIR *dir) {
|
|||
* @param dir is the object opendir() or fdopendir() returned
|
||||
* @return next entry or NULL on end or error, which can be
|
||||
* differentiated by setting errno to 0 beforehand
|
||||
* @threadunsafe
|
||||
*/
|
||||
struct dirent *readdir(DIR *dir) {
|
||||
struct dirent *e;
|
||||
|
@ -535,7 +536,6 @@ struct dirent *readdir(DIR *dir) {
|
|||
* @param result will receive `output` pointer, or null on eof
|
||||
* @return 0 on success, or errno on error
|
||||
* @returnserrno
|
||||
* @threadsafe
|
||||
*/
|
||||
errno_t readdir_r(DIR *dir, struct dirent *output, struct dirent **result) {
|
||||
int err, olderr;
|
||||
|
@ -587,7 +587,6 @@ int closedir(DIR *dir) {
|
|||
|
||||
/**
|
||||
* Returns offset into directory data.
|
||||
* @threadsafe
|
||||
*/
|
||||
long telldir(DIR *dir) {
|
||||
long rc;
|
||||
|
@ -599,7 +598,6 @@ long telldir(DIR *dir) {
|
|||
|
||||
/**
|
||||
* Returns file descriptor associated with DIR object.
|
||||
* @threadsafe
|
||||
*/
|
||||
int dirfd(DIR *dir) {
|
||||
return dir->fd;
|
||||
|
@ -607,7 +605,6 @@ int dirfd(DIR *dir) {
|
|||
|
||||
/**
|
||||
* Seeks to beginning of directory stream.
|
||||
* @threadsafe
|
||||
*/
|
||||
void rewinddir(DIR *dir) {
|
||||
lockdir(dir);
|
||||
|
@ -634,7 +631,6 @@ void rewinddir(DIR *dir) {
|
|||
|
||||
/**
|
||||
* Seeks in directory stream.
|
||||
* @threadsafe
|
||||
*/
|
||||
void seekdir(DIR *dir, long tell) {
|
||||
lockdir(dir);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue