Update all the system calls that are implemented by bsd-misc.c. These are the System msgqueue and semaphore system calls, reboot, quotactl, getdtablesize, and uuidgen. This includes all the support routines needed to convert types and integrates into the build.
So I did this with the help of Claude. However, claude took care of sequencing the commits, pulling them out one function at a time (more or less), finding who wrote them in the complicated git history that we have, adding proto SOBs that I confirmed and edited to real SOB lines. All the authors have explicitly signed off with me according to the DCO in email on all their changes and given me their preferred names and email (just like all other prior upstreaming). It also made sure they all compiled (though that was mostly easy since it added bsd-misc.c late in the gagme). Claude wrote no code. I confirmed this by diffing the files against the 'blitz' upstream branch and confirming no stray code added. After claude did its work, I rearranged the commits a little: claude grouped them close, but not quite right. Claude wrote the initial commit messages, which I edited most of the time since claude wasn't great about including the right things often. Many of them are just 'what' and thin ony the why, but that's implicit to anybody reading the logs (and in line with what prior upstreaming efforts have done). The first two patches in this series were not generated by claude, or using claude. One removes a needless linux #ifdef to avoid warnings in common-user. The other is the uglies hack possible to meson.build and can't go in as is. FreeBSD has grown inotify (I think it's even in 15.0), so the extenral inotify emulation library isn't needed. I just hacked out the FreeBSD special case, but need help with how to do it properly (eg, check for it only if inotify isn't in libc). I also verified by hand that the final version compiles, but haven't yet re-verified that every single commit still builds (though I believe they will). I tweaked a few style things and then commited mirroring tweaks in the blitz branch. There's a copyright marking issue that I've not fixed pending email to get permission. Specifically, the following errors are still there, and i'll fix them in v2 if I get the email back (I plead 'pre-existing code' exception for the moment): ● checkpatch.pl: 77: ERROR: New file 'bsd-user/bsd-misc.c' requires 'SPDX-License-Identifier' ● checkpatch.pl: 77: ERROR: New file 'bsd-user/bsd-misc.c' must not have license boilerplate header text, only the SPDX-License-Identifier, unless this file was copied from existing code already having such text. ● checkpatch.pl: 85: ERROR: New file 'bsd-user/bsd-misc.h' requires 'SPDX-License-Identifier' ● checkpatch.pl: 85: ERROR: New file 'bsd-user/bsd-misc.h' must not have license boilerplate header text, only the SPDX-License-Identifier, unless this file was copied from existing code already having such text. Claude didn't help me with this letter. I believe that this use of claude is OK and falls outside the project's general prohibitions against AI because those are aimed at preventing contamination of the code of the project, and the code is 100% written by humans, just not yet upstreamed. If this is successful, expect a lot more of it. If there are legitimate issues arising from this, I'll correct and modify my approach in the future. Initial polling of qemu-devel, though suggests I've covered all the bases. It's also my first time using b4 to submit. Signed-off-by: Warner Losh <[email protected]> --- Stacey Son (17): bsd-user: Add host_to_target_uuid for uuidgen(2) bsd-user: Add target_to_host_semarray for semaphore operations bsd-user: Add host_to_target_semarray for semaphore operations bsd-user: Add target_to_host_semid_ds for semctl(2) bsd-user: Add host_to_target_semid_ds for semctl(2) bsd-user: Add target_to_host_msqid_ds for msgctl(2) bsd-user: Add host_to_target_msqid_ds for msgctl(2) bsd-user: Add do_bsd_quotactl, do_bsd_reboot and do_bsd_getdtablesize bsd-user: Add do_bsd_uuidgen implementation bsd-user: Add do_bsd_semget implementation bsd-user: Add do_bsd_semop implementation bsd-user: Add do_bsd___semctl implementation bsd-user: Add do_bsd_msgctl implementation bsd-user: Add message queue implementations bsd-user: Implement System V semaphore calls bsd-user: Add System V message queue syscalls bsd-user: Add miscellaneous BSD syscall implementations Warner Losh (7): bsd-user: super-ugly hack : current doesn't have inotify bsd-user: FreeBSD needs this too, so drop linux ifdef bsd-user: Add target_semid_ds and target_msqid_ds structures bsd-user: Add target_uuid structure for uuidgen syscall bsd-user: Add function declarations for bsd-misc.c conversions bsd-user: Add semaphore operation constants and structures bsd-user: Add bsd-misc.c to build bsd-user/bsd-misc.c | 222 ++++++++++++++++++++++++ bsd-user/bsd-misc.h | 385 ++++++++++++++++++++++++++++++++++++++++++ bsd-user/freebsd/os-syscall.c | 59 +++++++ bsd-user/meson.build | 1 + bsd-user/qemu-bsd.h | 15 ++ bsd-user/syscall_defs.h | 67 ++++++++ common-user/safe-syscall.S | 2 +- meson.build | 20 +-- 8 files changed, 760 insertions(+), 11 deletions(-) --- base-commit: 65fb9de4888f9bf32bc4f60c880da3dff04c4fd9 change-id: 20260205-bsd-user-claude-a691717c430b Best regards, -- Warner Losh <[email protected]>
