• 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.

  • 相关阅读:
    JsonResponse
    python导出数据到excel
    ftp上传文件到服务器
    js设计模式 —— 订阅发布模式
    reducer的作用
    redux设置和使用三大原则
    js事件监听
    图片占位符
    正则练习
    正则基础
  • 原文地址:https://www.cnblogs.com/diyunpeng/p/2092421.html
Copyright © 2020-2023  润新知