-
Notifications
You must be signed in to change notification settings - Fork 49
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
libsubprocess: update read/write functions to be more like read(2) and write(2) #5953
Comments
chu11
added a commit
to chu11/flux-core
that referenced
this issue
May 13, 2024
Problem: The flux_subprocess_read() family of functions return a ptr to a buffer on success and length of buffer in an optional parameter. This API style isn't the most intuitive as it is quite different than the read(2) system call. Most notably when EOF is reached on a read stream you have to check if the buffer pointer is non-NULL and the length returned from an optional parameter is 0. Solution: Update the read family of functions to return the length from the function and the buffer pointer in an optional parameter. Update all callers accordingly. Fixes flux-framework#5953
chu11
added a commit
to chu11/flux-core
that referenced
this issue
May 13, 2024
Problem: The flux_subprocess_read() family of functions return a ptr to a buffer on success and length of buffer in an optional parameter. This API style isn't the most intuitive as it is quite different than the read(2) system call. Most notably when EOF is reached on a read stream you have to check if the buffer pointer is non-NULL and the length returned from an optional parameter is 0. Solution: Update the read family of functions to return the length from the function and the buffer pointer in an optional parameter. Update all callers accordingly. Fixes flux-framework#5953
chu11
added a commit
to chu11/flux-core
that referenced
this issue
May 13, 2024
Problem: The flux_subprocess_read() family of functions return a pointer to a buffer on success and length of buffer in an optional parameter. This API style isn't the most intuitive as it is quite different than the read(2) system call. Most notably when EOF is reached on a read stream you have to check if the buffer pointer is non-NULL and the length returned from an optional parameter is 0. Solution: Update the read family of functions to return the length from the function and the buffer pointer in an optional parameter. Update all callers accordingly. Fixes flux-framework#5953
chu11
added a commit
to chu11/flux-core
that referenced
this issue
May 14, 2024
Problem: The flux_subprocess_read() family of functions return a pointer to a buffer on success and length of buffer in an optional parameter. This API style isn't the most intuitive as it is quite different than the read(2) system call. Most notably when EOF is reached on a read stream you have to check if the buffer pointer is non-NULL and the length returned from an optional parameter is 0. Solution: Update the read family of functions to return the length from the function and the buffer pointer in an optional parameter. Update all callers accordingly. Fixes flux-framework#5953
chu11
added a commit
to chu11/flux-core
that referenced
this issue
May 14, 2024
Problem: The flux_subprocess_read() family of functions return a pointer to a buffer on success and length of buffer in an optional parameter. This API style isn't the most intuitive as it is quite different than the read(2) system call. Most notably when EOF is reached on a read stream you have to check if the buffer pointer is non-NULL and the length returned from an optional parameter is 0. Solution: Update the read family of functions to return the length from the function and the buffer pointer in an optional parameter. Update all callers accordingly. Fixes flux-framework#5953
chu11
added a commit
to chu11/flux-core
that referenced
this issue
May 16, 2024
Problem: The flux_subprocess_read() family of functions return a pointer to a buffer on success and length of buffer in an optional parameter. This API style isn't the most intuitive as it is quite different than the read(2) system call. Most notably when EOF is reached on a read stream you have to check if the buffer pointer is non-NULL and the length returned from an optional parameter is 0. Solution: Update the read family of functions to return the length from the function and the buffer pointer in an optional parameter. Update all callers accordingly. Fixes flux-framework#5953
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Per comment in #5940, a number of the libsubprocess API functions are a little odd in that they return a pointer to a buffer rather than an int. This is b/c they were designed following the
flux buffer
(i.e. nowfbuf
) api. Make them moreread(2)
andwrite(2)
like ...ssize_t flux_subprocess_read (flux_subprocess_t *p, const char *stream, const void **buf);
The text was updated successfully, but these errors were encountered: