Skip to content

Commit

Permalink
Fix Lock API
Browse files Browse the repository at this point in the history
  • Loading branch information
fjtrujy committed Apr 20, 2024
1 parent 2f49416 commit a42edf3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion newlib/configure.host
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ case "${host}" in
mips*-psp-*)
sys_dir=psp
posix_dir=posix
newlib_cflags="${newlib_cflags} -DHAVE_NANOSLEEP -DHAVE_RENAME -DHAVE_FCNTL -D_NO_POSIX_SPAWN"
newlib_cflags="${newlib_cflags} -DHAVE_NANOSLEEP -DHAVE_RENAME -DHAVE_FCNTL -D_NO_POSIX_SPAWN -DHAVE_DD_LOCK"
;;
mmix-knuth-mmixware)
sys_dir=mmixware
Expand Down
4 changes: 3 additions & 1 deletion newlib/libc/misc/lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ subroutines are required for linking multi-threaded applications.

/* dummy lock routines and static locks for single-threaded apps */

#ifndef __SINGLE_THREAD__
#include <newlib.h>

#if defined(__SINGLE_THREAD__)

#include <sys/lock.h>

Expand Down
1 change: 1 addition & 0 deletions newlib/libc/sys/psp/sys/dirent.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ typedef struct __dirdesc {
char *dd_buf; /* buffer */
int dd_len; /* buffer length */
int dd_size; /* amount of data in buffer */
void *dd_lock; /* lock */
} DIR;

# define __dirfd(dp) ((dp)->dd_fd)
Expand Down

0 comments on commit a42edf3

Please sign in to comment.