• pclose : no child process 规格严格


    I am trying to debug something at work, and I must admit, I'm no UNIX
    expert. I'm stumped and I thought I'd see if anyone in the community
    has an idea. It's a pretty simple operation that does simple commands
    like cksum, scp, and chmod with a pipe. The code uses popen to open a
    pipe and run a command. It does this so it can get the result of the
    command and put it in a log. The string returned from the command is
    valid, so the popen command properly executed the command. However,
    when pclose is run, the return code is always -1 and the errno is 10
    (no child process).

    What's weird is that this same code runs fine on all the other
    environments we have set up, even on servers that have the same OS and
    version. The server that this is failing on is Sun 5.9.

    Everything I have read about pclose failing like this has to do with
    complicated multithreaded cases, but in this case the only processes
    being called are simple commands that execute immediately. Has anyone
    seen anything like this? Someone else set up this environment, are
    there any settings I should check that might make the environment do
    this? Thanks

    Solution:

    Does your application contain modify the disposition of the SIGCHLD
    signal? If so, this could interfere with popen's ability to wait for
    the shell to exit.

  • 相关阅读:
    TCP协议报文段的解析
    在阿里云轻量级云服务器上安装redis
    MySQL学习(一)
    GIT学习(一)
    speed up gradle
    Android Studio plugins recommend
    Android Activity life circle brief
    install and use gradle
    Android Studio, Failed to install Intel HAXM
    Vue3 ref、reactive、toRef、toRefs的区别
  • 原文地址:https://www.cnblogs.com/diyunpeng/p/2092421.html
Copyright © 2020-2023  润新知