Sponsored Content
Full Discussion: Setui(0) memory fault
Top Forums UNIX for Advanced & Expert Users Setui(0) memory fault Post 302336586 by mrodrig on Wednesday 22nd of July 2009 11:58:13 AM
Old 07-22-2009
Error Setui(0) memory fault

Hi i have this code that used to wrok fine in unix mp-ras.
After the migration to linux suse i recompiled the script and now when it is executed i get a Memory fault (coredump) message.

Does anybody knows why' what should I change?
tks

SCRIPT

Code:
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/stat.h>

int main(int argc, char * argv[])
{
   setuid( 0 );
   /*chmod( argv[1], S_IRWXU || S_IRWXG || S_IROTH );*/
   chmod( argv[1], 00775 );
}


Last edited by Yogesh Sawant; 07-28-2009 at 05:52 AM.. Reason: added code tags
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Memory Fault

I am using Unix OpenServer Release 5. When a run a application with user different to "Superuser" the application give me the following error: "Memory Fault - Core Dump". What's that mean? Thank you in advance. Roberto Veras. (1 Reply)
Discussion started by: robertoveras
1 Replies

2. Programming

Memory fault(coredump)

Dear All, I made a program which do some simple jobs like reading data from other process's shared memory and writing messages to the queues of other process. what happens is my program works fine and do all the task as expected but then then program ends it give Memory fault(coredump). I... (0 Replies)
Discussion started by: ralo
0 Replies

3. Programming

memory fault

When I excute a program . It seems to generate an error : memory fault (core dump ) So how can i (1 Reply)
Discussion started by: iwbasts
1 Replies

4. UNIX for Advanced & Expert Users

Memory fault in ql session

Hi, Am getting memory fault when i start ql session in SCO unix server. Can any one suggest the way to solve this issue. Thanks (0 Replies)
Discussion started by: param_it
0 Replies

5. Ubuntu

Memory fault(coredump)

Hey guys, I am new to the Linux world and have a question to post. When I ssh from a HP-UX machine to a ubuntu machine I get the following error message Memory fault(coredump) i.e. ssh 192.168.1.3 I get this message as shown below Memory fault(coredump) Can someone please explain... (2 Replies)
Discussion started by: fkaba81
2 Replies

6. UNIX for Dummies Questions & Answers

mysql memory fault

I (think I) installed MYSQL on a Red Hat box. When I try to start mysql I get a memory fault error. Any ideas on how to fix this? Here is some info that might help: My distro info $ cat /proc/version Linux version 2.4.21-40.ELsmp (bhcompile@hs20-bc1-7 .build.redhat.com) (gcc version 3.2.3... (0 Replies)
Discussion started by: wsetchell
0 Replies

7. Linux

Help with memory fault

We have migrated our application from HP UX to linux. The code is in 4gl and after migration it has started giving Memory fault while running a batch job. The trace shows segmentation fault after a series of recvfrom and sendto(DB read) sigsegv segmentation fault @ 0 0 killed by SIGSEGV The... (2 Replies)
Discussion started by: aimee
2 Replies

8. UNIX for Dummies Questions & Answers

Page Fault + Memory

I am not sure where to post this so i will put it in the newbie section. I have set up a bog standard debain 6, LAMP environment in the cloud. The specs 1 core at 2GH 2.5gb Memory running Jommla, with about 1.6K visitors a day. I am using AppFirst (appfirst.com) to monitor the... (2 Replies)
Discussion started by: waseem
2 Replies

9. Homework & Coursework Questions

Memory fault(coredump)

I am writing a program that copies a program and prints the program with a line count. this is the program I wrote: #include <stdio.h> main() { int c; int nl_cnt = 0; while((c = getchar()) != EOF){ if(c = '\n'){ nl_cnt++;... (3 Replies)
Discussion started by: heywoodfloyd
3 Replies

10. Solaris

M4000 Memory Fault

Hi Guys and Gals, Does anyone know how to track down a faulty DIMM on the memory board of an M4000? showhardconf tells me which board it is, but was wondering if there was a way to track it down to a DIMM? Thanks in advance Martin (5 Replies)
Discussion started by: callmebob
5 Replies
getopt(3)						     Library Functions Manual							 getopt(3)

Name
       getopt - get option letter from argument vector

Syntax
       #include <stdio.h>
       int getopt (argc, argv, optstring)
       int argc;
       char **argv;
       char *optstring;

       extern char *optarg;
       extern int optind, opterr;

Description
       The  subroutine	returns the next option letter in argv that matches a letter in optstring.  The optstring is a string of recognized option
       letters; if a letter is followed by a colon, the option is expected to have an argument that may or may not be separated from it  by  white
       space.  The optarg is set to point to the start of the option argument on return from

       The  function places in optind the argv index of the next argument to be processed.  The external variable optind is automatically initial-
       ized to 1 before the first call to

       When all options have been processed (that is, up to the first non-option argument), returns EOF.  The special option --  may  be  used	to
       delimit the end of the options; EOF will be returned, and -- will be skipped.

Diagnostics
       The function prints an error message on stderr and returns a question mark (?)  when it encounters an option letter that is not included in
       optstring.  Setting opterr to 0 disables this error message.

Examples
       The following code fragment shows how one might process the arguments for a command that can take the mutually exclusive options a  and	b,
       and the options f and o, both of which require arguments:
       #include <stdio.h>
       main (argc, argv)
       int argc;
       char **argv;
       {
	      int c;
	      extern int optind, opterr;
	      extern char *optarg;
	      .
	      .
	      .
	      .
	      while ((c = getopt (argc, argv, "abf:o:")) != EOF)
		       switch (c) {
		       case 'a':
			       if (bflg)
				       errflg++;
			       else
				       aflg++;
			       break;
		       case 'b':
			       if (aflg)
				       errflg++;
			       else
				       bproc( );
			       break;
		       case 'f':
			       ifile = optarg;
			       break;
		       case 'o':
			       ofile = optarg;
			       bufsiza = 512;
			       break;
		       case '?':
			       errflg++;
		       }
	       if (errflg) {
		       fprintf (stderr, "usage: . . . ");
		       exit (2);
	       }
	       for ( ; optind < argc; optind++) {
		      if (access (argv[optind], 4)) {
	       .
	       .
	       .
       }

See Also
       getopt(1)

																	 getopt(3)
All times are GMT -4. The time now is 10:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy