11-17-2014
The most common reasons for an application to die with a segmentation fault (assuming no one explicitly sent it a SIGSEGV signal) are:
- using an uninitiaized pointer,
- buffer overflow (allocating a buffer of size x and writing into buffer[n] where n >= x or n < 0 [in C, valid array offsets are 0 to n-1]), or
- searching for the end of a string in a character array that does not include a terminating null byte.
10 More Discussions You Might Find Interesting
1. Programming
Hi Everybody,
I have gone through man of sigwait and new to UNIX signals. Could anyone explain me about the following lines mentioned in sigwait man help ?
"The selection of a signal in set is independent of the signal
mask of the calling thread or LWP. This means a thread or
LWP can ... (1 Reply)
Discussion started by: md7ahuja
1 Replies
2. Programming
Hi All,
When I ran a multithreaded program in c++, it was core dumped
when its core was analysed
it indicated that the program was terminated with signal 9.
Signal 9 cannot be caught or interrupted.
When i analyzed the core further, it showed SING error
what could be the reason for... (6 Replies)
Discussion started by: matrixmadhan
6 Replies
3. AIX
I have some questions :
1) We can system backup manual by remotely? (Ex: we peform backup a AIX system in Japan from US)How we can do?
2) We can build a script to system backup automatically? How we can do?
3) We can use which third party to do that? Which tool?
Thanks (1 Reply)
Discussion started by: guest
1 Replies
4. HP-UX
Hi all,
I am getting coredump in one of our programs. The last few lines of the tucs output are as below :
read(8, "\adb\0\006\0\0\0\0\0060 0 9 2 6 ".., 2064) ...... = 2011
read(8, "\adb\0\006\0\0\0\0\07 4 1 4 5 03".., 2064) ...... = 2011
read(8, "\adb\0\006\0\0\0\0\00 2 6 030 0 ".., 2064)... (0 Replies)
Discussion started by: santosh.mane
0 Replies
5. Shell Programming and Scripting
I honestly tried searching for this in this forum and in google. Maybe I found the answer but didn't even realized it.
I would like to run shell script thats on my machine that collects the hostname and IP address from the remote system and sends the output to my machine.
I'm not sure if need... (2 Replies)
Discussion started by: elbombillo
2 Replies
6. UNIX for Advanced & Expert Users
Hi,
When i run the code in solaris unix machine, the file from remote server is getting downloaded. but when i use the same code in IBM AIX remote machine, it is not running. It is saying "Erro during scp transfer." Below is the code.
Please give some resolution.
SCPClient client = new... (1 Reply)
Discussion started by: gravi2020
1 Replies
7. Solaris
how to login with ssh to remote system with out applying the remote root/user password
with rlogin we can ujse .rhosts file
but with ssh howits possible
plz guide (2 Replies)
Discussion started by: tv.praveenkumar
2 Replies
8. Shell Programming and Scripting
Hi Friends,
I am new to this , I am working on AIX system and my scenario is to retrive the files from remote system and remove the files from the remote system after retreving files. I can able to retrieve the files but Can't remove files in remote system. Please check my code and help me out... (3 Replies)
Discussion started by: vinayparakala
3 Replies
9. Shell Programming and Scripting
Hi,
I have an shell script program in a remote linux machine which will do some specific monitoring functionality. Also, have some C executables in that machine.
From a windows machine, I want to run the shell script program (If possible using java).
I tried with SSH for this. but, in... (1 Reply)
Discussion started by: ram.sj
1 Replies
10. Shell Programming and Scripting
Hello Every one!!
I am trying to write a shell script which will connect to a remote server and execute scripts which are at a certain path in the remote server.
Before this I am using a sudo command to change the user.
The place where I am stuck is, I am able to connect to the... (6 Replies)
Discussion started by: masubram
6 Replies
strncpy(9r) strncpy(9r)
NAME
strncpy - General: Copies a null-terminated character string with a specified limit
SYNOPSIS
char * strncpy(
char *s1,
char *s2,
int n );
ARGUMENTS
Specifies a pointer to a buffer of at least n bytes. Specifies a pointer to a string (an array of characters terminated by a null charac-
ter). Specifies the number of characters to be copied.
DESCRIPTION
The strncpy routine copies string s2 to buffer s1. The routine stops copying after it copies a null character or n characters, whichever
comes first. If the length of s2 as determined by the null character is less than n, the routine pads s1 with null characters.
RETURN VALUES
The strncpy routine returns a pointer to /NULL at the end of the first string (or to the location following the last copied character if
there is no NULL). The copied string will not be null terminated if the length of s2 is n characters or more.
SEE ALSO
Routines: bcopy(9r), blkclr(9r), copystr(9r), ovbcopy(9r), strcpy(9r)
strncpy(9r)