LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 08-17-2013, 09:08 PM   #1
ehabababneh
LQ Newbie
 
Registered: Apr 2009
Posts: 15

Rep: Reputation: 0
Where can I find the source code for the "swapon" command line tool?


Where can I find the source code for the "swapon" command line tool?

I need to modify the source code for this tool to do my own stuff. I am using ubuntu.

Thanks all.
 
Old 08-17-2013, 09:40 PM   #2
astrogeek
Senior Member
 
Registered: Oct 2008
Distribution: Slackware [64]X{.0|.1|.2|-current} ::X>=12<=14, FreeBSD_10{.0|.1}
Posts: 2,201

Rep: Reputation: 863Reputation: 863Reputation: 863Reputation: 863Reputation: 863Reputation: 863Reputation: 863
From man swapon (Slackware 12):

Quote:
The swapon command is part of the util-linux-ng package and is available from ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/
From man swapon (Slackware current):

Quote:
The swapon command is part of the util-linux package and is available from ftp://ftp.kernel.org/pub/linux/utils/util-linux/

Last edited by astrogeek; 08-17-2013 at 09:44 PM.
 
Old 08-17-2013, 09:43 PM   #3
ehabababneh
LQ Newbie
 
Registered: Apr 2009
Posts: 15

Original Poster
Rep: Reputation: 0
Is this the source code for the tool: http://cristi.indefero.net/p/uClibc-...ommon/swapon.c ?

I thought it would be part of the coreutils.

Anyways, is it really doing nothing but doing the syscall? I thought it would do some initial sanity checks, for example checking for the file/block device!
 
Old 08-17-2013, 09:45 PM   #4
ehabababneh
LQ Newbie
 
Registered: Apr 2009
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by astrogeek View Post
From man swapon:
Thanks for the quick reply!

The link in your reply isn't working. I will check out the package and see if I can get it.

Thanks again.
 
Old 08-17-2013, 09:47 PM   #5
ehabababneh
LQ Newbie
 
Registered: Apr 2009
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by astrogeek View Post
From man swapon (Slackware 12):



From man swapon (Slackware current):
ok...here is the link: https://www.kernel.org/pub/linux/uti...l-linux/v2.23/

Thank you again!
 
Old 08-17-2013, 09:48 PM   #6
astrogeek
Senior Member
 
Registered: Oct 2008
Distribution: Slackware [64]X{.0|.1|.2|-current} ::X>=12<=14, FreeBSD_10{.0|.1}
Posts: 2,201

Rep: Reputation: 863Reputation: 863Reputation: 863Reputation: 863Reputation: 863Reputation: 863Reputation: 863
Quote:
Originally Posted by ehabababneh View Post
Is this the source code for the tool: http://cristi.indefero.net/p/uClibc-...ommon/swapon.c ?

I thought it would be part of the coreutils.

Anyways, is it really doing nothing but doing the syscall? I thought it would do some initial sanity checks, for example checking for the file/block device!
I don't know anything about uClibc-cristi, but it looks like it just uses the syscall.

I copied and pasted the link from the man page, it might contain spaces or hyphens, but go to kernel.org and find it there.

You are welcome!

---------- Post added 08-17-13 at 07:48 PM ----------

Quote:
Originally Posted by ehabababneh View Post
ok...here is the link: https://www.kernel.org/pub/linux/uti...l-linux/v2.23/

Thank you again!
Ah! OK thanks!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to find "feature" in the source code SaintDanBert Linux - Software 3 07-01-2013 08:38 PM
Red Hat 6 :Where can I find the source code of "useradd" redrat Linux - Software 3 09-08-2011 05:09 PM
compiling code resulting in: 'unrecognized command line "-fstart-group"' freeindy Programming 2 05-14-2008 02:28 AM
command line counter tool to replace "sleep" kutlu Linux - Software 3 12-25-2007 11:42 PM
"who" command source code sameeeruj Linux - General 2 07-04-2007 03:13 AM


All times are GMT -5. The time now is 07:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration