Strange errors when trying to use sysinfo() in sched.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I added this into sched.c so I could use the sysinfo function to adjust some of
the tunables based on that info.  It gave these warnings and a couple of other
complaints that I fixed but I just want to make sure what they are.

/* Seems to be important for using the sysinfo function and structure
 */

int errno;
_syscall1(int, sysinfo, struct sysinfo *, info);

/* SYSTEM INFO STRUCTURE ~AMF
 *  "Turning knobs" above to be reset according to system info.
 */
struct sysinfo s_info;

/* Flag for large time slices.
 * So that the swap_tuner() doesn't keep enlarging the time slices
 */
int ltSlices4567 = 0;

/* Changed the name of the above to something random so not to overwrite
 * anything that already existed.
 */

[root@pc163094 linux-2.6.9]# make bzImage
  CHK     include/linux/version.h
make[1]: `arch/i386/kernel/asm-offsets.s' is up to date.
  CHK     include/linux/compile.h
  CC      kernel/sched.o
kernel/sched.c:3015: warning: `interruptible_sleep_on' is deprecated (declared
at kernel/sched.c:3003)
kernel/sched.c:3049: warning: `sleep_on_timeout' is deprecated (declared at
kernel/sched.c:3035)
  LD      kernel/built-in.o
  GEN     .version
  CHK     include/linux/compile.h
  UPD     include/linux/compile.h
  CC      init/version.o
  LD      init/built-in.o
  LD      .tmp_vmlinux1
  KSYM    .tmp_kallsyms1.S
  AS      .tmp_kallsyms1.o
  LD      .tmp_vmlinux2
  KSYM    .tmp_kallsyms2.S
  AS      .tmp_kallsyms2.o
  LD      vmlinux
  SYSMAP  System.map
  SYSMAP  .tmp_System.map
  AS      arch/i386/boot/setup.o
  LD      arch/i386/boot/setup
  OBJCOPY arch/i386/boot/compressed/vmlinux.bin
  GZIP    arch/i386/boot/compressed/vmlinux.bin.gz
  LD      arch/i386/boot/compressed/piggy.o
  LD      arch/i386/boot/compressed/vmlinux
  OBJCOPY arch/i386/boot/vmlinux.bin
  BUILD   arch/i386/boot/bzImage
Root device is (3, 5)
Boot sector 512 bytes.
Setup is 4970 bytes.
System is 1217 kB
Kernel: arch/i386/boot/bzImage is ready
[root@pc163094 linux-2.6.9]#

The other errors were that it was complaining about a bool I used as a flag to
say whether I'd enlarged the time slices or not.  Changing it to an int fixed
it
partly and then renaming it from ltSlices stopped an error where it was
mentioned I was redefining something.  I just want to make sure that really was
the error and that I wasn't doing something wrong by changing it's value
further
down the file.  I've noticed tome very strange rules to using c while I've been
learning about linux and also some strange exceptions to usual rules.  It can
be
difficult to know what to enter in a search engine or look up in a book when I
don't know how to describe what I need.

I also needed to add a variable called errno to get it to work.  I assume it
expected me to handle that part myself (and assign errors to each value that
errno could receive), but I would have thought it would have made more sense to
include errno in the header with the functions so I'm wondering if I did the
right thing adding it myself.


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux