aboutsummaryrefslogtreecommitdiff
path: root/loslib.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Added gcc option '-Wconversion'Roberto Ierusalimschy2024-07-271-1/+1
| | | | | No warnings for standard numerical types. Still pending alternative numerical types.
* llimits.h being used by all Lua codeRoberto Ierusalimschy2024-06-201-0/+1
| | | | | | The definitions in llimits.h are useful not only for the core. That header only defines types and '#define's, so libs and core still do not share any real code/data.
* More disciplined use of 'errno'Roberto Ierusalimschy2024-06-121-0/+2
| | | | | | | | | Set errno to zero before calling any function where we may use its errno, and check errno for zero before using it (as functions may not set it even in error). The code assumes that no function will put garbage on errno (although ISO C allows that): If any function during an operation set errno, and the operation result in an error, assume that errno has something to say.
* Simpler definition for LUA_STRFTIMEOPTIONSRoberto Ierusalimschy2023-02-071-15/+6
| | | | There is no need for those intermediate definitions.
* New macro LUA_USE_IOSRoberto Ierusalimschy2023-02-021-12/+5
| | | | | Do not try to detect automatically whether system is iOS; it is simpler and more reliable to let the programmer inform that.
* Fix absence of 'system' in iOSRoberto Ierusalimschy2023-01-241-1/+17
| | | | | Despite claiming to be ISO, the C library in some Apple platforms does not implement 'system'.
* Small simplification in overflow check in 'getfield'Roberto Ierusalimschy2022-09-231-3/+1
| | | | | Subtracting a small non-negative int from a non-negative int cannot overflow, and adding a non-negative int to INT_MIN cannot overflow.
* Broadening the use of branch hintsRoberto Ierusalimschy2021-02-241-4/+4
| | | | | | More uses of macros 'likely'/'unlikely' (renamed to 'l_likely'/'l_unlikely'), both in range (extended to the libraries) and in scope (extended to hooks, stack growth).
* 'luaL_execresult' does not assume -1 status as errorRoberto Ierusalimschy2020-05-221-2/+4
| | | | | | | | | | | ISO C is silent about the return of 'system'. Windows sets 'errno' in case of errors. Linux has several different error cases, with different return values. ISO C allows 'system' to set 'errno' even if there are no errors. Here we assume that a status==0 is success (which is the case on several platforms), otherwise it is an error. If there is an error number, gives the error based on it. (The worst a spurious 'errno' can do is to generate a bad error message.) Otherwise uses the normal results.
* Several details about 5.4.0 rc1Roberto Ierusalimschy2020-04-231-1/+1
| | | | | Corrected several small details: added 'const', adjusts in tabs x spaces, removed unused #includes and #defines, misspellings, etc.
* Comments (mosty typos)Roberto Ierusalimschy2019-12-301-1/+1
|
* Some improvements in date/time functionsRoberto Ierusalimschy2019-07-241-28/+48
| | | | | | - Range in date table extended to full 32 bits. - Easier support for times represented as floats. - Added more tests.
* Removed resource-related "emergency collections"Roberto Ierusalimschy2018-10-311-2/+0
| | | | | New to-be-closed variables is a better way to ensure the proper release of resources.
* Added "emergency collection" to 'io.tmpfile' and 'os.tmpname'Roberto Ierusalimschy2018-07-271-0/+2
| | | | | | | | These operations also can give errors for lack of resources, so they also will try "emergency collections" in case of resource errors. Because there are now two libraries with that kind of handling, 'resourcetryagain' was moved to the auxiliary library to be shared by the libraries.
* File operations try an "emergency collection" when failingRoberto Ierusalimschy2018-07-251-2/+1
| | | | | | | | | If a file operation fails do to lack of resources (too many open files or not enough memory), it does a full garbage collection and tries the operation again. Lack of resources are "too many open files" (process wise and system wise) and "not enough memory". The code is full of '#if's because error codes are not part of the standard ISO C.
* added 'return' to calls to 'luaL_error' (to signal to the compilerRoberto Ierusalimschy2017-03-141-3/+5
| | | | that the function cannot continue past that call)
* bug: 'checkoption' could read past end of string + 'os.date' canRoberto Ierusalimschy2016-07-181-12/+16
| | | | handle embedded zeros
* 'os.time(t)' normalizes 't' fieldsRoberto Ierusalimschy2016-04-181-10/+20
|
* simpler yet definition for 'checkoption'Roberto Ierusalimschy2016-02-091-18/+14
|
* simpler code for 'checkoption' + added conversion specifiers specificRoberto Ierusalimschy2016-02-081-25/+34
| | | | to Windows
* details (comments + text of error messages)Roberto Ierusalimschy2016-01-061-5/+5
|
* details (typos in comments)Roberto Ierusalimschy2015-11-191-2/+2
|
* 'strftime' puts its result directly into 'lua_Buffer'Roberto Ierusalimschy2015-07-061-5/+9
|
* better treatment for integer overflows + all errors throw an errorRoberto Ierusalimschy2015-07-041-23/+37
| | | | (instead of returning nil)
* re-organization of initial configuration optionsRoberto Ierusalimschy2015-04-101-27/+40
|
* detail (no need to write 'double' in source)Roberto Ierusalimschy2015-02-091-3/+4
|
* typo in error messageRoberto Ierusalimschy2015-01-121-2/+2
|
* detail (to avoid warnings)Roberto Ierusalimschy2014-12-261-3/+3
|
* new specifiers in 'strftime' are defined in C99 (not Posix)Roberto Ierusalimschy2014-12-101-3/+3
|
* comments (references to "ANSI C" changed to "ISO C", which is theRoberto Ierusalimschy2014-11-021-3/+3
| | | | international name
* added include for 'lprefix.h', for stuff that must be added beforeRoberto Ierusalimschy2014-11-021-4/+6
| | | | any other header file
* `name' in comments changed to 'name'Roberto Ierusalimschy2014-10-251-2/+2
|
* macros 'LUA_QL'/'LUA_QL' deprecatedRoberto Ierusalimschy2014-10-171-2/+2
|
* added some casts for the cases when lua_Number != doubleRoberto Ierusalimschy2014-10-081-2/+3
|
* deprecated "cast macros" ('luaL_checkint', 'luaL_optint', etc.)Roberto Ierusalimschy2014-10-011-2/+2
|
* template for 'mkstemp' is configurable (via LUA_TMPNAMTEMPLATE)Roberto Ierusalimschy2014-04-291-2/+8
|
* configuration for Lua type corresponding to 'time_t'Roberto Ierusalimschy2014-03-201-10/+24
|
* lua_gettable and similars return type of gotten valueRoberto Ierusalimschy2014-03-121-3/+2
|
* removal of weird construction in definition of LUA_STRFTIMEOPTIONSRoberto Ierusalimschy2014-02-261-3/+3
| | | | (two empty strings concatenated as in "" "")
* more uniformity for defining system-dependent featuresRoberto Ierusalimschy2014-02-261-7/+18
|
* uses integers for timeRoberto Ierusalimschy2013-05-141-5/+5
|
* error message in 'os.rename' does not include file name, because errorRoberto Ierusalimschy2012-10-191-2/+2
| | | | may be caused both by 'fromname' or 'toname'
* spaces -> tabs in #definesRoberto Ierusalimschy2012-05-231-8/+9
|
* 'lUA' -> 'LUA'Roberto Ierusalimschy2011-11-301-2/+2
|
* when available, use '*_r' versions of 'gmtime' and 'localtime'Roberto Ierusalimschy2011-11-291-4/+21
|
* another try to avoid warnings about unreachable 'return' after 'exit'Roberto Ierusalimschy2011-11-291-2/+3
|
* commentRoberto Ierusalimschy2011-06-201-2/+2
|
* returns for file-related functions and process-related functionsRoberto Ierusalimschy2011-03-031-19/+10
| | | | unified in 'auxlib'
* detail (cleaning trailing spaces)Roberto Ierusalimschy2011-01-261-2/+2
|
* 'os.exit' acceps booleans as status (for EXIT_SUCESS and EXIT_FAILURE)Roberto Ierusalimschy2010-10-051-2/+6
|