Find the answer to your Linux question:
Results 1 to 3 of 3
If I wanted to implement the equivalent of the system call 'sysctl -w net.ipv4.ip_forward=1' in code, any pointers on how I can do that? I can make a system call ...
  1. #1
    Just Joined!
    Join Date
    May 2009
    Posts
    6

    Equivalent of sysctl

    If I wanted to implement the equivalent of the system call

    'sysctl -w net.ipv4.ip_forward=1'

    in code, any pointers on how I can do that?

    I can make a system call but i wanted to know if there is an alternative..

    TIA

  2. #2
    Just Joined!
    Join Date
    May 2009
    Posts
    6
    to clarify, i want to avoid the 'syscall'..

  3. #3
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    I suspect not since these are kernel settings and you need to use a system call in order to communicate with the kernel, AFAIK.

    So, why are you trying to avoid the use of syscall or the command sysctl?
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...