좀 애매.. 한.. 쩝...

익명 사용자의 이미지

음.. ㅡㅡ;
좀 애매해서요.. 안되는건 확실한데.. 뭐가 문제인지를 모르겠군요..
일단.. 프로그램은

main(void)
{
pid_t pid;
if((pid = fork()) <0)
printf("fork error 1\n");
else if(pid == 0)
{
if(execv("/bin/ls", NULL) <0)
printf("exec error_1\n");
if(waitpid(pid, NULL, 0) < 0)
printf("wait pid error1\n");
}
printf("##################################\n");
if((pid = fork()) <0)
printf("fork error 2\n");
else if(pid == 0)
{
if(execle("/bin/ls", "ls", "-al", (char *)0) < 0)
printf("exec error 2\n");
if(waitpid(pid, NULL, 0) < 0)
printf("wait pid error2\n");
}
exit(0);
}

입니다. 뭐 그냥 테스트해볼 요량으로 만든겁니다.
일단.. gcc로 컴파일 했을때는 문제가 없습니다.
그런데.. 크로스 컴파일 해서 임베디드시스템에 올리니까 문제가 있군요..

임베디드상에서는
##################################
exec error 2
wait pid error2

로 결과가 나옵니다.
(정상적이라면 ls 명령 후에 ###가 나오고 다음에 ls -al 명령이 나온형
태 입니다. 위의 결과는 ls에서는 에러가 없되 출력이 안된거고, ###는 정
상출력, ls -al에서는 에러가 난것이지요...)

음.. 되짚어 본다면.. gcc로는 되었으니까 소스에는 문제가 없는걸로 판단
했구요, 또한 크로스 컴파일러도 검증된거니까 문제가 없는것으로 ..

또 임베디드 시스템에서 'ls' 나 'ls -al' 은 되니까 이것도 문제가 없을
거 같거든요..

그런데 왜!!!!! 안될까요.. ㅡㅡ;

제가 생각하는 가정은
1. execle 을 지원하지 않는다(라이브러리 등을..근데 execv는 되니까..
별로..)

2. ls나 여타 기본 명령어는 사실 busybox를 링크해서 한건데.. 이게 문제
가 있을 수 있겠다.. <-- 제가 busybox를 잘 몰라서 가늠하기 어려움.

3. 이건 시스템상에 따라 다르기 때문에 뭐라 말할 수가 없다!(면, 이것
을 어떤식으로 되짚어가서 해결해야 할까요..)

4. 임베디드 시스템의 커널이 꼬진거다!(2.2 쓰거든요.. ㅡㅡ;)

5. 원래 exe 계열명령이 되지를 않는다!(일반적으로 말이죠..)

ㅡㅡ;
쩝.... 임베디드 시스템이라는게 만드는 사람마다, 회사마다 달라서 사실
질문하기도 뭐하지만.. 어디 짚이는데라도 있으시면 귀뜸좀 부탁 합니
다...

아아.. 내공증진의 길은 멀고도.. 쿨럭
감사합니다.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.