Skip to content

Add backtrace definitions and support for statvfs #3359

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

Closed
wants to merge 2 commits into from
Closed

Add backtrace definitions and support for statvfs #3359

wants to merge 2 commits into from

Conversation

0323pin
Copy link
Contributor

@0323pin 0323pin commented Sep 23, 2023

This allows successful build and use of file deletion, a.k.a. move to trash

Tested with source build of simp with the trash feature enabled.
Without this commit, simp fails to build on NetBSD when the trash feature is enabled.

Moving a file to the trash bin:
2023-09-23-151144_1366x768_scrot

Verifying its existence in the trash bin:
2023-09-23-151421_1366x768_scrot

@rustbot
Copy link
Collaborator

rustbot commented Sep 23, 2023

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @JohnTitor (or someone else) soon.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@0323pin
Copy link
Contributor Author

0323pin commented Sep 23, 2023

🎉 All checks have passed 😃

@JohnTitor
Copy link
Member

  1. Edit the related semver file as stated in the PR template, please read it first.
  2. Have you ensured the link item is available on the minimal NetBSD environment? If not, this change would break someone's code.

@0323pin
Copy link
Contributor Author

0323pin commented Sep 24, 2023

  1. Edit the related semver file as stated in the PR template, please read it first.

Done, I've added the new symbols to semver now.

  1. Have you ensured the link item is available on the minimal NetBSD environment? If not, this change would break someone's code.

Yes, these are available in the base OS, so they are available on a minimal environment.

@JohnTitor
Copy link
Member

Great, could you squash commits into one too?

@0323pin
Copy link
Contributor Author

0323pin commented Sep 24, 2023

Great, could you squash commits into one too?

Need to look into it later.

@0323pin
Copy link
Contributor Author

0323pin commented Sep 24, 2023

@JohnTitor I'm not really sure on how to do this as I've synced my fork with master in between my commits.

This is how it looks like at my end,

2023-09-24-150227_1366x768_scrot

Can't you simply use squash and merge at your end?

@JohnTitor
Copy link
Member

Can't you simply use squash and merge at your end?

Sadly no, we use the bot named @bors to run full CI and merge.

Add backtrace definitions and support for statvfs

android adding few more pthread api calls.

Declare `pthread_attr_setguardsize` and `pthread_attr_getstacksize`.

Declare `pthread_attr_setguardsize` and `pthread_attr_getstacksize` on
all platforms which have `pthread_attr_getguardsize` and
`pthread_attr_setstacksize`, respectively.

Delete a now-redundant `pthread_attr_getstacksize` declaration.

Add symbols

Add statvfs also
@rustbot
Copy link
Collaborator

rustbot commented Sep 24, 2023

Some changes occurred in OpenBSD module

cc @semarie

@0323pin
Copy link
Contributor Author

0323pin commented Sep 24, 2023

@JohnTitor Is this ok?

If not, it's probably easier for me to start from a new fork and do a new pull request.

@0323pin
Copy link
Contributor Author

0323pin commented Sep 25, 2023

Please advice.

@0323pin 0323pin closed this Sep 25, 2023
bors added a commit that referenced this pull request Sep 25, 2023
Add backtrace definitions and support for statvfs

Replaces #3359

This allows successful build and use of file deletion, a.k.a. _move to trash_

Tested with a source build of `simp` with the **trash** feature enabled.
Without this commit, `simp` fails to build on NetBSD when the **trash** feature is enabled.

Also, I've added the new symbols to semver and made sure these functions are available on a minimal NetBSD environment.
bors added a commit that referenced this pull request Sep 25, 2023
Add backtrace definitions and support for statvfs

Replaces #3359

This allows successful build and use of file deletion, a.k.a. _move to trash_

Tested with a source build of `simp` with the **trash** feature enabled.
Without this commit, `simp` fails to build on NetBSD when the **trash** feature is enabled.

Also, I've added the new symbols to semver and made sure these functions are available on a minimal NetBSD environment.
bors added a commit that referenced this pull request Sep 29, 2023
backtrace definitions and support for getmntinfo and getvfsstat

After the failures of merging #3361 as a follow-up to #3359 I've spent sometime making sure everything is indeed supported and defined.

```
~> grep -r "MNT_WAIT" /usr/include/sys/fstypes.h; grep -r "MNT_NOWAIT" /usr/include/sys/fstypes.h; grep -r "MNT_LAZY" /usr/include/sys/fstypes.h
#define	MNT_WAIT	1	/* synchronously wait for I/O to complete */
#define	MNT_NOWAIT	2	/* start all I/O, but do not wait for it */
#define	MNT_LAZY 	3	/* push data not written by filesystem syncer */
```

```
~> grep -r "getmntinfo" /usr/include/sys/; grep -r "getvfsstat" /usr/include/sys/
/usr/include/sys/statvfs.h:int	getmntinfo(struct statvfs **, int)
/usr/include/sys/statvfs.h:    __RENAME(__getmntinfo90);
/usr/include/sys/fstypes.h: * waitfor flags to vfs_sync() and getvfsstat()
/usr/include/sys/statvfs.h:int	getvfsstat(struct statvfs *, size_t, int)
/usr/include/sys/statvfs.h:    __RENAME(__getvfsstat90);
/usr/include/sys/syscall.h:/* syscall: "compat_90_getvfsstat" ret: "int" args: "struct statvfs90 *" "size_t" "int" */
/usr/include/sys/syscall.h:#define	SYS_compat_90_getvfsstat	356
/usr/include/sys/syscall.h:/* syscall: "__getvfsstat90" ret: "int" args: "struct statvfs *" "size_t" "int" */
/usr/include/sys/syscall.h:#define	SYS___getvfsstat90	483
/usr/include/sys/syscallargs.h:struct compat_90_sys_getvfsstat_args {
/usr/include/sys/syscallargs.h:check_syscall_args(compat_90_sys_getvfsstat)
/usr/include/sys/syscallargs.h:struct sys___getvfsstat90_args {
/usr/include/sys/syscallargs.h:check_syscall_args(sys___getvfsstat90)
/usr/include/sys/syscallargs.h:int	compat_90_sys_getvfsstat(struct lwp *, const struct compat_90_sys_getvfsstat_args *, register_t *);
/usr/include/sys/syscallargs.h:int	sys___getvfsstat90(struct lwp *, const struct sys___getvfsstat90_args *, register_t *);
```

Also, I've made sure the code compiles with rustc 1.72.0 without warning or errors.

```
~> cargo build --release
    Updating crates.io index
   Compiling libc v0.2.148 (/home/pin/Git/libc)
    Finished release [optimized] target(s) in 8.87s
```

Moreover, the _move to trash_ functionality has again been verified using [simp](https://github.com/Kl4rry/simp) compiled with this commit as patch, in combination with the patch submited to [trash-rs](Byron/trash-rs#84).

`@JohnTitor` Please give bors another try
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants