LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-29-2006, 05:48 PM   #1
lokeshmaremalla
LQ Newbie
 
Registered: Mar 2006
Posts: 2

Rep: Reputation: 0
strncpy function definition required


Hi,

Could anyone post the source code for strncpy present in linux OS

Thanks,
 
Old 11-29-2006, 08:11 PM   #2
tuxdev
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 2,012

Rep: Reputation: 115Reputation: 115
First, unless you are talking about klibc, Linux itself doesn't have a "strncpy".
Secondly, Erm, why do you need this?
 
Old 11-29-2006, 08:12 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Homework ???
 
Old 11-29-2006, 09:51 PM   #4
lokeshmaremalla
LQ Newbie
 
Registered: Mar 2006
Posts: 2

Original Poster
Rep: Reputation: 0
to clarify my doubt on strncpy implementation

Quote:
Originally Posted by syg00
Homework ???
I am not a student and i am working.
But unfortunately i didn't have linux OS in my system so i would like to get the definition to clarify my doubt on implementation.

and it is present in the path
/usr/src/linux2.4 or some thing like that
or
we can get the path where it is present by doing grep on strncpy.

your help is more appreciated.

thanks.
 
Old 11-29-2006, 09:58 PM   #5
dmail
Member
 
Registered: Oct 2005
Posts: 970

Rep: Reputation: Disabled
click click

Come on isn't that just being lazy? After all you are telling people how to search
Quote:
and it is present in the path
/usr/src/linux2.4 or some thing like that
or
we can get the path where it is present by doing grep on strncpy.

Last edited by dmail; 11-29-2006 at 10:02 PM.
 
Old 11-29-2006, 10:10 PM   #6
tuxdev
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 2,012

Rep: Reputation: 115Reputation: 115
If you need this in a non open source project, you must use something with the BSD license. Also, you should use strlcpy, it does what you expect as something that was designed to be safe, not co-opted into the role.
 
Old 11-29-2006, 10:42 PM   #7
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
Quote:
Originally Posted by syg00
Homework ???
This calls for a Haiku
Quote:
Originally Posted by old man thimblelips
Cold winter
Home work difficult
Plagiarise
 
  


Reply



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
Using __THROW in function definition drimades Programming 1 11-15-2006 05:50 AM
I can't find where the definition of the function pci_bus_read_config_byte() frisky Linux - Software 5 06-25-2006 05:07 AM
function definition query slzckboy Programming 1 04-18-2006 08:29 AM
Defining a non-inline function inside class definition (tm) Programming 6 05-11-2005 09:14 AM
diff between strcpy and strncpy djgerbavore Programming 11 08-04-2004 07:01 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:29 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
Open Source Consulting | Domain Registration