Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unix.execv* declared result type (should be 'a) #8491

Closed
vicuna opened this issue Feb 19, 2004 · 2 comments
Closed

Unix.execv* declared result type (should be 'a) #8491

vicuna opened this issue Feb 19, 2004 · 2 comments

Comments

@vicuna
Copy link

vicuna commented Feb 19, 2004

Original bug ID: 2273
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_Name: Basile STARYNKEVITCH
Version: 3.07 & latest CVS
OS: Linux
Submission from: www-rocqbis.inria.fr (192.93.2.12)

The Unix.execv* family of functions are declared as follow in unix.mli

val execv : string -> string array -> unit
val execve : string -> string array -> string array -> unit
val execvp : string -> string array -> unit
val execvpe : string -> string array -> string array -> unit

These functions never return - they either raise a Unix exception or succeed in
the execve(2) syscall (which change the running program, so don't return). So
they should be typed as
val execv : string -> string array -> 'a
val execve : string -> string array -> string array -> 'a
val execvp : string -> string array -> 'a
val execvpe : string -> string array -> string array -> 'a

Also, the exit function (which also does not return) is correctly typed (in
pervasives.mli) as
val exit : int -> 'a

(having access to the CVS, I offer to make the small patch if it is accepted)

@vicuna
Copy link
Author

vicuna commented Feb 23, 2004

Comment author: administrator

These functions never return - they either raise a Unix exception or succeed in
the execve(2) syscall (which change the running program, so don't return). So
they should be typed as
val execv : string -> string array -> 'a
val execve : string -> string array -> string array -> 'a
val execvp : string -> string array -> 'a
val execvpe : string -> string array -> string array -> 'a

Also, the exit function (which also does not return) is correctly typed (in
pervasives.mli) as
val exit : int -> 'a

(having access to the CVS, I offer to make the small patch if it is accepted)

OK pour faire le changement. Merci,

  • Xavier

@vicuna
Copy link
Author

vicuna commented Apr 1, 2004

Comment author: administrator

Change done by BS 2004-02-25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant