mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
execve(2) now sets errno=EACCESS on non-buffer files.
This commit is contained in:
parent
9deb183786
commit
e234e0a2d4
3 changed files with 5 additions and 3 deletions
|
@ -18,5 +18,6 @@
|
||||||
#define EPERM 26
|
#define EPERM 26
|
||||||
#define EIO 27
|
#define EIO 27
|
||||||
#define ENOEXEC 28
|
#define ENOEXEC 28
|
||||||
|
#define EACCESS 29
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -32,7 +32,7 @@ namespace Maxsi
|
||||||
{
|
{
|
||||||
DEFN_SYSCALL1(int, SysRegisterErrno, 28, int*);
|
DEFN_SYSCALL1(int, SysRegisterErrno, 28, int*);
|
||||||
|
|
||||||
extern "C" int errno = 0;
|
extern "C" { int errno = 0; }
|
||||||
|
|
||||||
extern "C" void init_error_functions()
|
extern "C" void init_error_functions()
|
||||||
{
|
{
|
||||||
|
@ -58,9 +58,10 @@ namespace Maxsi
|
||||||
case ENOMEM: return (char*) "Not enough space";
|
case ENOMEM: return (char*) "Not enough space";
|
||||||
case ERANGE: return (char*) "Result too large";
|
case ERANGE: return (char*) "Result too large";
|
||||||
case EISDIR: return (char*) "Is a directory";
|
case EISDIR: return (char*) "Is a directory";
|
||||||
case EPERM: return (char*) "Permission denied";
|
case EPERM: return (char*) "Operation not permitted";
|
||||||
case EIO: return (char*) "Input/output error";
|
case EIO: return (char*) "Input/output error";
|
||||||
case ENOEXEC: return (char*) "Not executable";
|
case ENOEXEC: return (char*) "Not executable";
|
||||||
|
case EACCESS: return (char*) "Permission denied";
|
||||||
default: return (char*) "Unknown error condition";
|
default: return (char*) "Unknown error condition";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -397,7 +397,7 @@ namespace Sortix
|
||||||
delete[] abs;
|
delete[] abs;
|
||||||
|
|
||||||
if ( !dev ) { return NULL; }
|
if ( !dev ) { return NULL; }
|
||||||
if ( !dev->IsType(Device::BUFFER) ) { dev->Unref(); return NULL; }
|
if ( !dev->IsType(Device::BUFFER) ) { Error::Set(EACCESS); dev->Unref(); return NULL; }
|
||||||
return (DevBuffer*) dev;
|
return (DevBuffer*) dev;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue