Fwd: swapon and swapoff testcases on busybox
Denis Vlasenko
vda.linux at googlemail.com
Tue Mar 13 14:10:05 PDT 2007
Hi
On Tuesday 13 March 2007 08:44, Riaz Rahaman wrote:
> BTW..the bb swaponoff file checks for the condition (st.st_blocks * 512 <
> st.st_size) and gives a message if the swap file has holes...now do we
> require this check in the busybox? can bb not call the swapon syscall from
> swaponoff code..swapon syscall also seems to be doing the check.
I removed that check.
> Why is it that the block size has been hard code to 512 bytes? Any
> particular reason for that?
Hmmm... dunno! ;)
> I find that the linux kernel syscall swapon is the one givng me message that
> my swap file has holes.
I have deep doubts that kernel syscalls can give error messages.
At most, they return error code. ;)
If I got you right, status is nonzero here:
if (applet_name[5] == 'n')
status = swapon(device, 0);
else
status = swapoff(device);
if (status != 0) {
bb_perror_msg("%s", device);
What is printed by bb_perror_msg in your testcase?
--
vda
More information about the busybox
mailing list