File operations try an "emergency collection" when failing

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.
This commit is contained in:
Roberto Ierusalimschy
2018-07-25 11:44:46 -03:00
parent ccae0f5aad
commit e885dee5ab
2 changed files with 65 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: loslib.c,v 1.65 2016/07/18 17:58:58 roberto Exp roberto $
** $Id: loslib.c $
** Standard Operating System library
** See Copyright Notice in lua.h
*/
@@ -10,7 +10,6 @@
#include "lprefix.h"
#include <errno.h>
#include <locale.h>
#include <stdlib.h>
#include <string.h>