zoukankan      html  css  js  c++  java
  • 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.

  • 相关阅读:
    maven 常用命令
    navicat 破解
    linux命令
    Git常用命令
    关于近期工作的总结
    ES6新特性学习
    Hadoop初步学习
    串行、并行与并发的理解
    通过Spring profile方式实现多环境部署
    使用MySQL乐观锁解决超卖问题
  • 原文地址:https://www.cnblogs.com/diyunpeng/p/2092421.html
Copyright © 2011-2022 走看看