linux-mips
[Top] [All Lists]

execve errno setting on MIPS

To: <linux-mips@linux-mips.org>
Subject: execve errno setting on MIPS
From: "Sadashiiv, Halesh" <halesh.sadashiv@ap.sony.com>
Date: Thu, 18 Sep 2008 17:09:35 +0530
Importance: normal
Original-recipient: rfc822;linux-mips@linux-mips.org
Priority: normal
Sender: linux-mips-bounce@linux-mips.org
Thread-index: AckZgzm/T9gNDGOUS1OLOnTq63CX4w==
Thread-topic: execve errno setting on MIPS
Hi all,
 
Please find the below testcase..
 
#include <stdio.h>
#include <limits.h>
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
 
#define EXE_NAME "./exe"
 
char e2BIG[ARG_MAX+1][10];
char *envList[]={NULL};
 
int main(void)
{
  int ret,ind;
 
  for(ind = 0; ind < ARG_MAX+1; ind++)
    strcpy(e2BIG[ind], "helloword");
 
  if ((ret = chmod(EXE_NAME,0744)) != 0){
    printf("chmod failed\n");
    exit(1);
  }
 
  /* whne arg list is too long */
  if ((ret = execve(EXE_NAME,e2BIG,envList)) == -1) {
    if ( errno == E2BIG)
      printf("Test Pass\n");
    else
      printf("Test Fail : Got Errno %d\n", errno);
    exit(0);
  }
  else
    printf("execve worked out of limit\n");
  exit(1);
}
 
On MIPS E2BIG is not getting set as errno instead EFAULT is set, while on 
other archs like ARM, PowerPC and i686 I am able to get E2BIG.
 
Please let me know about the issue...
 
Let EXE_NAME be any executable....
 
Thanks,
Halesh

 



This email is confidential and intended only for the use of the individual or entity named above and may contain information that is privileged. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this email is strictly prohibited. If you have received this email in error, please notify us immediately by return email or telephone and destroy the original message. - This mail is sent via Sony Asia Pacific Mail Gateway.
<Prev in Thread] Current Thread [Next in Thread>