Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 317341

Summary: [PATCH] sys-apps/sandbox (git): add libkvm support for FreeBSD + minor build fix
Product: Gentoo Linux Reporter: Alexis Ballier <aballier>
Component: Current packagesAssignee: Sandbox Maintainers <sandbox>
Status: RESOLVED WONTFIX    
Severity: normal CC: bsd+disabled
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: libkvm support
new version
new patch again
updated version

Description Alexis Ballier gentoo-dev 2010-04-26 18:41:39 UTC
libkvm allows to get the command line used for a process; it's used here as an alternative of reading /proc which is not available on FreeBSD.
Comment 1 Alexis Ballier gentoo-dev 2010-04-26 18:42:06 UTC
Created attachment 229293 [details, diff]
libkvm support
Comment 2 SpanKY gentoo-dev 2010-04-27 17:01:44 UTC
style problems:
 - sys/sysctl.h order is incorrect in configure.ac
 - HAVE_XXX values should be defined/undefined, not 0/1 ... then use #ifdef
 - style in sb_get_kvm_cmdline() is broken in many ways
 - replace sb_get_cmdline instead of a new sb_get_kvm_cmdline() -- have it return a dummy file name
 - move the contents of sb_get_kvm_cmdline() to your own sb_copy_file_to_fd().  if you want to extend the arguments to also pass in the pid, that's fine.
Comment 3 Alexis Ballier gentoo-dev 2010-04-27 17:57:41 UTC
Created attachment 229423 [details, diff]
new version
Comment 4 Alexis Ballier gentoo-dev 2010-04-27 18:00:06 UTC
Created attachment 229425 [details, diff]
new patch again

missed one #if -> #ifdef
Comment 5 Alexis Ballier gentoo-dev 2010-04-27 18:01:14 UTC
(In reply to comment #2)
> style problems:
>  - sys/sysctl.h order is incorrect in configure.ac
>  - HAVE_XXX values should be defined/undefined, not 0/1 ... then use #ifdef

done

>  - style in sb_get_kvm_cmdline() is broken in many ways

please be more verbose

>  - replace sb_get_cmdline instead of a new sb_get_kvm_cmdline() -- have it
> return a dummy file name
>  - move the contents of sb_get_kvm_cmdline() to your own sb_copy_file_to_fd(). 
> if you want to extend the arguments to also pass in the pid, that's fine.

done and renamed to match the extra argument
Comment 6 SpanKY gentoo-dev 2010-04-27 18:54:05 UTC
reading the rest of the file shows the correct style ...
 - you need whitespace between for/if and the paren
 - whitespace doesnt save code, so you need spaces after the semicolons in for() and commas in function arguments
 - dont put if statements on the same line
 - you dont need the paren in the 3rd arg to kvm_getprocs
 - it's "type *var", not "type * var".
Comment 7 Alexis Ballier gentoo-dev 2010-04-27 21:13:59 UTC
Created attachment 229447 [details, diff]
updated version