You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 1410 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
Bug description
Sur mes Solaris 2.6:
Unix.stat "/dev/zero";;
Exception: Unix.Unix_error (Unix.EOVERFLOW, "stat", "/dev/zero").
Je crains que ça ne vienne de stat.c:
CAMLprim value unix_stat(value path)
{
int ret;
struct stat buf;
ret = stat(String_val(path), &buf);
if (ret == -1) uerror("stat", path);
if (buf.st_size > Max_long) unix_error(EOVERFLOW, "stat", path);
return stat_aux(0, &buf);
}
SUS V2 dit:
off_t st_size file size in bytes (if file is a regular file)
Le man Linux:
The value st_size gives the size of the file (if it is a
regular file or a symlink) in bytes.
mais je pense que c'est OK aussi pour les directories.
Xavier, veux-tu que je fasse la modification ?
Bruno.
The text was updated successfully, but these errors were encountered:
Sur mes Solaris 2.6:
Unix.stat "/dev/zero";;
Exception: Unix.Unix_error (Unix.EOVERFLOW, "stat", "/dev/zero").
Je crains que ça ne vienne de stat.c:
if (buf.st_size > Max_long) unix_error(EOVERFLOW, "stat", path);
SUS V2 dit:
off_t st_size file size in bytes (if file is a regular file)
I.e. si le fichier n'est pas un "regular file", on renvoie la taille
donnée par stat, modulo 2^31. Ainsi, si stat() renvoie une taille
significative pour les répertoires ou les liens, l'utilisateur la
verra (et cette taille très probablement ne déborde pas le type "int").
Et si stat() renvoie une taille non significative, on fait garbage in,
garbage out.
Original bug ID: 1410
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Sur mes Solaris 2.6:
Unix.stat "/dev/zero";;
Exception: Unix.Unix_error (Unix.EOVERFLOW, "stat", "/dev/zero").
Je crains que ça ne vienne de stat.c:
CAMLprim value unix_stat(value path)
{
int ret;
struct stat buf;
ret = stat(String_val(path), &buf);
if (ret == -1) uerror("stat", path);
if (buf.st_size > Max_long) unix_error(EOVERFLOW, "stat", path);
return stat_aux(0, &buf);
}
SUS V2 dit:
off_t st_size file size in bytes (if file is a regular file)
Le man Linux:
The value st_size gives the size of the file (if it is a
regular file or a symlink) in bytes.
mais je pense que c'est OK aussi pour les directories.
Xavier, veux-tu que je fasse la modification ?
Bruno.
The text was updated successfully, but these errors were encountered: