Commit Graph

194 Commits

Author SHA1 Message Date
fincs
b30b567228
fsdev: Convert time into proper POSIX UTC timestamps (FS reports local time instead) 2019-09-22 18:14:10 +02:00
fincs
ecbc77840e
fs: Update names of enum/flag types for style consistency and correctness 2019-09-21 19:54:21 +02:00
fincs
77888f8b1f
fs: Use new IPC interface + fixes, see details:
- Argument types corrected to better reflect their actual types
  (mostly several incorrect instances of size_t were changed to u64)
- Const correctness fixes
- fsEventNotifierGetEventHandle changed to output an Event (with
  user configurable autoclear) instead of a raw Handle
2019-09-21 16:27:15 +02:00
fincs
8a0aef8824
Fix new compiler warnings raised by GCC 9.x 2019-09-21 00:58:33 +02:00
friedkeenan
fdb1605fc5 Require whole mount name to match when finding a romfs (#324) 2019-09-02 21:22:49 +02:00
fincs
01d648e7ed Add support for new homebrew ABI keys + loader info 2019-07-29 21:17:09 +02:00
SciresM
e1a6a463c2 Add enums for GetInfo/GetSystemInfo (#292) 2019-06-22 00:05:56 +02:00
yellows8
006ebc0633
Fixed romfsUnmount RemoveDevice handling. 2019-06-13 19:41:35 -04:00
Pablo Curiel
e3d7b12c96 Remove RomFS devoptab device on unmount. 2019-06-08 17:16:55 +02:00
Michael Scire
ac9d76f373 fs: fix file/storage API, add fsdevCreateFile, add fsOpenFileSystemWithPatch. 2019-06-03 14:48:45 -04:00
yellows8
90620daf05
Added romfsMountFromCurrentProcess(). 2019-05-17 11:15:43 -04:00
Michael Scire
39db25c81d romfs_dev: fix unmounting/corruption when mounting multiple. 2019-05-09 12:42:15 +02:00
SciresM
e114a361be fsdev: add way of getting last returned result. (#276)
Adds fsdevGetLastResult, which returns a thread local Result updated by every call to fsdev_translate_error.

Also changes fsdev_translate_error to return EIO instead of raw results, when not translatable.
2019-05-08 16:44:17 +02:00
Adubbz
1d3e208807 Added fsdevDeleteDirectoryRecursively 2019-05-05 18:26:08 +02:00
Ezekiel Bethel
26458fc1e8 add 0x402 (path exists) => EEXIST mapping in fs_dev 2019-04-09 22:16:34 -04:00
fincs
a469a68b20 Add custom extension to MOD0 header & a few other useful symbols 2019-04-08 16:36:45 +02:00
yellows8
fd9e02b271
Added romfsMountFromFsdev and fsdevTranslatePath. Internal romfs_dev improvements. 2019-03-29 19:49:08 -04:00
fincs
56471670ee Remove old C11 threads implementation 2019-03-29 18:40:26 +01:00
fincs
9d9b2efe29 devkitA64 r13 support changes, including pthread support 2019-03-29 18:40:26 +01:00
fincs
626b07fac8 Implement TLS slot support (with destructors) 2019-03-29 18:40:26 +01:00
Michael Scire
5575966d0c fix fsdev bug 2019-03-25 00:02:18 +01:00
Michael Scire
1bea504732 Added fsOpenDataStorageByDataId and romfsMountFromDataArchive 2019-03-25 00:02:18 +01:00
Michael Scire
43128b613b romfs: refactor to allow specifying mount name 2019-03-25 00:02:18 +01:00
yellows8
81ce04eb7b In nxlinkStdio(), return sock on success instead of ret. 2019-02-27 19:15:31 -05:00
fincs
11b7bece4a Change all services except fatal to use hosversion* instead of kernelAboveXYZ 2019-02-18 21:48:49 +01:00
fincs
61cc738730 Introduce hosversion.h - HOS version detection utilities
- Simplify kernel/detect.h logic; introduce detectKernelVersion()
- Use set:sys (if available) during __appInit in order to initialize
  the current HOS version
2019-02-18 21:48:41 +01:00
Cpasjuste
855a719728 c11-threads: return thrd_timedout on cnd_timedwait timeout (#232) 2019-01-09 13:33:23 +01:00
fincs
5039c0815e console_sw: Switch to PIXEL_FORMAT_RGB_565, optimize scrollWindow 2018-12-19 19:33:31 +01:00
fincs
1b18a3b056 console_sw: Use Framebuffer object instead of old gfx api. Moved RGBA8/_MAXALPHA to framebuffer.h. 2018-12-19 19:33:31 +01:00
fincs
3a77a7ace8 Introduce nwindowGetDefault 2018-12-19 19:33:31 +01:00
yellows8
725ac9f00a Moved usb code specific to usbds into seperate .c/.h. 2018-11-28 17:34:53 -05:00
yellows8
36bed9f8fc Added support for getting file timestamps via 3.0.0+ fsFsGetFileTimeStampRaw, *stat() timestamps are now set when fsFsGetFileTimeStampRaw is successful. This is now used in fsdev_open() for supporting fstat. The sysver is now checked in fsFsCleanDirectoryRecursively(). Closes #204. 2018-11-20 14:22:19 -05:00
yellows8
12ee6e502e Fixed register corruption in crt0 introduced by the exception commit. Only handle exceptions when __libnx_exception_handler is defined by the user, and updated comments. 2018-11-14 20:55:17 -05:00
yellows8
5e69f760fb Added support for exception-handling. 2018-11-14 16:17:02 -05:00
SciresM
e19765445d fs: Add fsFsQueryEntry (and fsFsSetArchiveBit helper) (#202)
* fs: Add fsFsSetArchiveBit

* Add fsdevSetArchiveBit wrapper
2018-11-09 22:03:47 -05:00
yellows8
318562d13b Init/exit nifm in socketInitialize/socketExit, the user app no longer has to manually handle this when using gethostid/gethostname. Use domains for nifm. Style adjustments in nifm.c. 2018-10-23 14:04:58 -04:00
yellows8
cfbc3e9278 Added usbCommsSetErrorHandling, don't throw fatalSimple for usbComms by default. 2018-10-19 12:34:17 -04:00
fincs
8e1736c480 Add RandomSeed (14) homebrew ABI key and related handling 2018-10-17 17:17:05 +02:00
TuxSH
052fb34397 Reduce usage of malloc in select and poll. Fix poll not acceping -1 fds 2018-10-16 18:53:05 -04:00
yellows8
52686826d1 Added fsdevGetDeviceFileSystem(). 2018-10-12 22:13:14 -04:00
SciresM
347e3b3156 Refactor usb:ds, add 5.0.0+ support to usbComms. (#181)
* Refactor usb:ds, add support for 5.0.0+. Closes #109.
2018-10-11 15:35:22 -04:00
Thog
8178c0fa45 _socketDeserializeHostent: fix usage of uninitialized h_name 2018-10-08 21:44:30 -04:00
fincs
420d5d4e61 C11 thread support: address standard compilance issues
Also fixes #158
2018-10-06 22:00:31 +02:00
fincs
1563df3921 Refactor console device, see details:
- Added ConsoleRenderer interface, which abstracts all relevant
  operations needed to set up and write characters to a text mode display
- ConsoleFont now has tileWidth/tileHeight parameters
- PrintConsole now holds a pointer to a ConsoleRenderer
- Added consoleExit for deinitializing the console
- Added consoleUpdate for updating the display every frame
- Corrected lots of obsolete/outdated comments
- Separated console software renderer into its own file (console_sw.c)
- Added getDefaultConsoleRenderer weak function, for selecting the
  default console renderer when none (NULL) is specified in PrintConsole
- Software renderer now takes care of gfxInitDefault/gfxExit
- All these changes are backwards compatible with older programs because:
  - gfxInitDefault has double-init protection
  - Old programs don't call consoleUpdate/Exit, but their implementation
    in the software renderer is identical to what old programs were
    already doing anyway
2018-10-06 16:48:03 +02:00
yellows8
4fb364060c Added support for timezones, hence localtime() will now return actual localtime. Added timeToCalendarTimeWithMyRule and TimeCalendarTime/TimeCalendarAdditionalInfo, which are used for timezones support. 2018-10-05 19:59:24 -04:00
yellows8
b4859873ec Added env AppletFlags handling. Don't enter the msg-loop for AppletType_Application when the output from _appletGetCurrentFocusState is already 1. This fixes the hang issue with AppletType_Application where applet init with AppletType_Application was previously done. Moved AppletType_*Application checks into a dedicated function which also checks for AppletType_SystemApplication, hence some of these funcs which didn't check for AppletType_SystemApplication now support it. 2018-10-04 18:06:00 -04:00
yellows8
96dce1a8b6 In __libnx_gtod set errno to EIO instead of EINVAL when __boottime is invalid due to timeGetCurrentTime() failing during time init, and added this to __libnx_clock_gettime. Set errno to ENOSYS in __libnx_clock_settime. 2018-10-03 20:55:58 -04:00
yellows8
0b1b7039ca Changed the value of TimeType_Default to TimeType_UserSystemClock. When timeGetCurrentTime fails where __nx_time_type isn't TimeType_Default, call it again with TimeType_Default. 2018-10-03 19:48:33 -04:00
yellows8
16bbf3411e Added automatic process exit handling with applet cmds, see __nx_applet_exit_mode. appletSelfExit is no longer user-accessible, see __nx_applet_exit_mode instead. Added envSetExitFuncPtr. Added disabled _appletSetTerminateResult func. 2018-10-03 19:04:48 -04:00
fincs
eb11e25dc5 Add Module_HomebrewAbi/Loader. Reassign Module_LibnxBinder, as it inadvertently collided with Module_HomebrewLoader. 2018-09-27 21:03:29 +02:00
fincs
81d56a9e23 console: disable forced flush/swap/vblank due to performance reasons 2018-09-08 14:19:24 +02:00
fincs
7f8b6af64c runtime/newlib.c: use armGetSystemTick instead of svcGetSystemTick 2018-08-31 13:05:23 +02:00
plutooo
d8bb563546 Renamed gfx/ to display/ 2018-08-31 13:05:21 +02:00
fincs
80439a186b Add MOD0 header to crt0 2018-08-31 13:05:21 +02:00
Lioncash
d3f388d2c8 socket: Correct missing break within _socketParseBsdResult() 2018-08-09 14:53:41 +02:00
fincs
f3b530cea3 C11 threads: enable preemptive scheduler and load balancing 2018-08-06 17:59:51 +02:00
fincs
b181d725ac Use revised CondVar API in C11 threads impl 2018-08-05 14:32:10 +02:00
fincs
d255fe730b Experimental partial C11 threads support 2018-08-05 13:23:08 +02:00
Dave Murphy
be509f62ce return through libc exit rather than __libnx_exit directly (#139) 2018-07-26 18:01:40 +02:00
Dave Murphy
aa3c35e6e3 adjust fsdev_fixpath for cwd changes (#132)
* adjust fsdev_fixpath for cwd changes
2018-07-19 11:31:51 -04:00
Dave Murphy
35be7ac772 allow user additions to init/exit code (#124)
* allow user additions to init/exit code
2018-06-25 12:42:52 -04:00
Dave Murphy
8b2b12b454 fix _IOC cast 2018-06-14 18:26:29 -04:00
Dave Murphy
4e4d2fe3c6 translate horizon errno to newlib errno 2018-06-14 18:25:52 -04:00
Dave Murphy
70cd9e017d fix ioctl 2018-06-14 01:51:36 +02:00
Dave Murphy
9860ad331c implement nanosleep 2018-06-14 00:49:20 +02:00
jarulo
8b793729fc Fix inet_pton4 2018-06-12 13:08:27 +02:00
Somebody Whoisbored
ad4af954c2 Added nifm service (#110)
* Added nifm service
* Properly implemented gethostid
* Implemented gethostname
2018-06-07 18:00:51 -04:00
Dave Murphy
3326d5e62d Time fixes (#102)
* provide microseconds to gettimeofday
* implement clock functions
2018-06-07 15:35:41 -04:00
jarulo
a5381e43c0 Fix incorrect pointer reference in socketDeserializeAddrInfo 2018-05-29 15:29:39 -04:00
Dave Murphy
28ebb9ed0c implement nxlink stdio redirect (#94) 2018-05-17 00:22:47 +02:00
Dave Murphy
71036319a7 translate crlf eol markers to lf for consistency 2018-05-15 12:27:25 +02:00
yellows8
fdf0949562 Fixed parsing in _socketDeserializeHostent(). 2018-05-15 02:10:13 -04:00
yellows8
5ebe01191e Fixed hang in _socketDeserializeHostent(). 2018-05-14 12:37:56 -04:00
yellows8
ce718b3ac2 Set h_errno and errno for the socket.c 'Unimplementable functions'. 2018-05-14 12:32:07 -04:00
yellows8
c548a76763 In select(), use pollinfo revents instead of events when processing poll() output. 2018-05-10 20:11:07 -04:00
yellows8
c8d68ae853 Fixed _socketOpen(). 2018-05-10 12:35:55 -04:00
Dave Murphy
e648524fa5 fix stringop-truncation warnings (#84)
avoid gcc 8.1.0 diagnostics as per https://gcc.gnu.org/onlinedocs/gcc-8.1.0/gcc/Warning-Options.html#index-Wstringop-truncation
2018-05-08 21:58:38 +02:00
fincs
e001318c42 Fix strncat vulnerabilities in fs_dev.c [reported by @TuxSH] 2018-05-02 16:09:11 +02:00
fincs
2818c99dea Revise fsdev initialization, see details:
- Removed fsdevInit/Exit
- Now automatically initializing fsdev state on first mount
- Added fsdevMountSdmc (replaces fsdevInit)
- Added fsdevUnmountAll (replaces fsdevExit)
2018-05-01 19:06:14 +02:00
yellows8
37bb9a6b7f Added nacpGetLanguageEntry and SetLanguage_Total. 2018-04-18 23:38:01 -04:00
plutooo
daf819cb75 Stylefixes 2018-04-15 23:28:28 +02:00
yellows8
a3baa0eeb1 Allow using multiple interfaces with usbComms. Added usbComms Ex funcs. Use RwLock with usbComms. Various other usbComms changes. 2018-04-11 17:18:23 -04:00
Dave Murphy
45b36774e0 add socket flags translation 2018-03-25 17:51:09 +02:00
yellows8
51293c7fb0 In socket ioctl(), properly call fcntl-F_SETFL with the new flags. 2018-03-20 22:49:52 -04:00
Dave Murphy
21d27b935e modularise nxlink code 2018-03-18 20:51:49 +01:00
Dave Murphy
1394891509 better tag for nxlink host ip 2018-03-18 20:51:49 +01:00
Dave Murphy
23f577576c more checking of NXLINKED arg 2018-03-18 20:51:49 +01:00
Dave Murphy
e8fdd73561 add support for finding nxlink host 2018-03-18 20:51:49 +01:00
yellows8
49bea43cce Added envGetLastLoadResult(). 2018-03-11 17:40:28 -04:00
TuxSH
e0457c4534 Handle bsdInitialize failure codes properly 2018-02-27 19:14:44 +01:00
TuxSH
d33b26016d Add documentation to bsd.h and sfdnsres.h, etc. 2018-02-27 19:14:44 +01:00
TuxSH
3709ee92a5 Fix netdb functions 2018-02-27 19:14:44 +01:00
TuxSH
888f7e101f Fix inet_ntop6 2018-02-27 19:14:44 +01:00
TuxSH
472d305883 Move socket.c definitions around, fix bugs 2018-02-27 19:14:44 +01:00
TuxSH
dcf3e56300 Implement netdb.h functions, fix bugs, etc. 2018-02-27 19:14:44 +01:00
TuxSH
4b685d676b Add basic IPv6 definitions as sfdnsres seems to support it...
...also fix a bug in the inet_* functions.
2018-02-27 19:14:44 +01:00
TuxSH
0b92bb76b0 Add newlib wrapper for sockets...
... fix several bugs, etc.
2018-02-27 19:14:44 +01:00
yellows8
5664830f35 Fixed args parsing with quotes. 2018-02-27 02:14:23 -05:00
plutoo
d3cc781bf6 Stylefix for nro 2018-02-26 02:10:49 +01:00
Dave Murphy
0bbfbadc39 switch to 16x16 console font 2018-02-25 15:49:25 +01:00