Skip to content

Move fill_charp_buf from os to str #2620

New issue

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

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

Already on GitHub? # to your account

Closed
catamorphism opened this issue Jun 15, 2012 · 4 comments
Closed

Move fill_charp_buf from os to str #2620

catamorphism opened this issue Jun 15, 2012 · 4 comments
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup.
Milestone

Comments

@catamorphism
Copy link
Contributor

as per a FIXME in core::os

@kud1ing
Copy link

kud1ing commented Apr 25, 2013

It seems to me that os::as_c_charp() can be replaced with str::as_c_str().
Or is it hat os:c_char is not the same as libc::c_char?

@pnkfelix
Copy link
Member

@kud1ing : Nope, AFAICT, os::c_char is the same as libc::c_char (at least that's my interpretation of the use libc::{c_char, ...}; declaration at the top of os.rs.

I suspect the meat of this ticket is getting rid of fill_charp_buf (or migrating it to str). I'll see what happens to the build if I try to drop them.

@lilyball
Copy link
Contributor

fill_charp_buf should probably return an Option<CString> instead of Option<~str>. The only use in libstd is in self_exe_path(), which shouldn't be using ~str (due to #7225)

@brson
Copy link
Contributor

brson commented Oct 30, 2013

There is no longer anything called charp in libstd. Fixed in passing.

@brson brson closed this as completed Oct 30, 2013
RalfJung pushed a commit to RalfJung/rust that referenced this issue Oct 26, 2022
add pthread_getname_np

A new libstd test needs this, and there doesn't seem to be a good reason not to have this.
Aaron1011 pushed a commit to Aaron1011/rust that referenced this issue Jan 6, 2023
add pthread_getname_np

A new libstd test needs this, and there doesn't seem to be a good reason not to have this.
celinval added a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
Co-authored-by: Celina G. Val <celinval@amazon.com>
Co-authored-by: Adrian Palacios <73246657+adpaco-aws@users.noreply.github.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup.
Projects
None yet
Development

No branches or pull requests

5 participants