Incompatibility w/ Openserver 5 and Openserver 6 - SCO

This is a discussion on Incompatibility w/ Openserver 5 and Openserver 6 - SCO ; I support both OS5 and OS6 SCO customers. I tend to build all applications on OS5 and distributed to both OS5 and OS6 customers. This has always worked until I began using pseudo terminals. I have a "shell" that uses ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: Incompatibility w/ Openserver 5 and Openserver 6

  1. Incompatibility w/ Openserver 5 and Openserver 6

    I support both OS5 and OS6 SCO customers. I tend to build all
    applications on OS5 and distributed to both OS5 and OS6 customers.
    This has always worked until I began using pseudo terminals.

    I have a "shell" that uses pseudo terminals to drive the application
    passed on the command line. When I build on OS5 it works fine. When
    I build on OS6 it works fine. When I build on OS5 but deploy and
    execute on OS6, getpgid() -- used to insure the application is still
    active -- an EPERM (89) is generated by getpgid().


  2. Re: Incompatibility w/ Openserver 5 and Openserver 6

    On 31 May, 18:30, CJ wrote:
    > I support both OS5 and OS6 SCO customers. I tend to build all
    > applications on OS5 and distributed to both OS5 and OS6 customers.
    > This has always worked until I began using pseudo terminals.
    >
    > I have a "shell" that uses pseudo terminals to drive the application
    > passed on the command line. When I build on OS5 it works fine. When
    > I build on OS6 it works fine. When I build on OS5 but deploy and
    > execute on OS6, getpgid() -- used to insure the application is still
    > active -- an EPERM (89) is generated by getpgid().


    CJ,

    Nothing springs immediately to mind on this.

    Do you have a small piece of minimal failing source that reproduces
    the problem?

    Thanks,

    John


  3. Re: Incompatibility w/ Openserver 5 and Openserver 6

    On Jun 1, 3:25 am, jbol...@sco.com wrote:
    > On 31 May, 18:30, CJ wrote:
    >
    > > I support both OS5 and OS6 SCO customers. I tend to build all
    > > applications on OS5 and distributed to both OS5 and OS6 customers.
    > > This has always worked until I began using pseudo terminals.

    >
    > > I have a "shell" that uses pseudo terminals to drive the application
    > > passed on the command line. When I build on OS5 it works fine. When
    > > I build on OS6 it works fine. When I build on OS5 but deploy and
    > > execute on OS6, getpgid() -- used to insure the application is still
    > > active -- an EPERM (89) is generated by getpgid().

    >
    > CJ,
    >
    > Nothing springs immediately to mind on this.
    >
    > Do you have a small piece of minimal failing source that reproduces
    > the problem?
    >
    > Thanks,
    >
    > John


    John,

    Thanks for you time on this matter.

    Here is sample code that seems to show an binary incompatibility
    between OSR5 and OSR6. If I build and execute on the same SCO server,
    it runs as expected. However, if I build on OSR5 and take the
    binaries to OSR6, it fails.

    To execute use "parent child" the output should be as follows.

    before forkPty()
    child:after forkPty()
    child: starting child
    parent:after forkPty()
    child PID is 7610
    checking on child process
    checking on child process
    checking on child process
    checking on child process
    checking on child process
    checking on child process
    checking on child process
    checking on child process
    checking on child process
    getpgid: No such process
    checking on child process
    getpgid: No such process
    checking on child process
    getpgid: No such process
    checking on child process
    getpgid: No such process
    checking on child process
    getpgid: No such process

    /* child.c */
    #include
    #include
    #include
    #include
    #include

    int
    main(int argc,char *argv[])
    {
    pid_t pid;

    poll(0,0,2000);

    return(0);
    } /* int main(int argc,char *argv[]) */

    /* parent.c */
    #include
    #include
    #include
    #include
    #include
    #include
    #include
    #include
    #include
    #include
    #include
    #include

    extern char *ptsname(int);

    int stdErr = -1;

    pid_t
    forkPty(int *master)
    {
    pid_t child;

    /* Open a pseudo terminal master */
    if (0 <= (*master = open("/dev/ptmx",O_RDWR)))
    {
    grantpt(*master);
    unlockpt(*master);
    } /* if (0 <= open("/dev/ptmx",O_RDWR)) */
    else return((pid_t)-1);

    /* Start child process */
    child = fork();

    /* Fork failed */
    if ((pid_t)-1 == child)
    {
    close(*master);
    *master = -1;
    } /* if ((pid_t)-1 == child) */

    /* Child process */
    if (!(child))
    {
    int slave;

    /* Open a pseudo terminal slave */
    if (0 > (slave = open(ptsname(*master),O_RDWR))) _exit(-1);

    /* Open pseudo terminal slave as standard in,out, and err */
    dup2(slave,STDIN_FILENO);
    dup2(slave,STDOUT_FILENO);
    dup2(slave,STDERR_FILENO);

    close(*master);
    close(slave);
    *master = -1;
    } /* if (!(child)) */

    return(child);
    } /* pid_t forkPty(int *master) */

    int
    main(int argc,char *argv[])
    {
    int ptm;
    pid_t pid;
    int flags;

    stdErr = dup(STDERR_FILENO);
    if (0 < (flags = fcntl(stdErr,F_GETFD,0)))
    fcntl(stdErr,F_SETFD,(flags & ~(FD_CLOEXEC)));

    signal(SIGCHLD,SIG_IGN);

    write(stdErr,"before forkPty()\n",17);
    pid = forkPty(&ptm);

    if ((pid_t)-1 == pid)
    {
    perror("forkPty");
    exit(-1);
    } /* if ((pid_t)-1 == pid) */

    if ((pid_t)0 == pid)
    {
    char buf[1024];

    write(stdErr,"child:after forkPty()\n",22);

    sprintf(buf,"child: starting %s\n",argv[1]);
    write(stdErr,buf,strlen(buf));

    signal(SIGCHLD,SIG_IGN);
    execvp(argv[1],&argv[1]);

    sprintf(buf,"child: execvp failed, errno %d(%s)\n",
    errno,strerror(errno));
    write(stdErr,buf,strlen(buf));
    _exit(-2);
    } /* if ((pid_t)0 == pid) */

    write(stdErr,"parent:after forkPty()\n",23);
    printf("child PID is %lu\n",(long)pid);
    for(;
    {
    static int trys = 5;

    printf("checking on child process\n");
    /* system("ps -fl"); */
    if (0 > getpgid(pid))
    {
    perror("getpgid");

    if (!(--trys)) exit(3);
    }
    poll(0,0,250);

    if ((0)) break;
    } /* for(; */

    return(0);
    } /* int main(int argc,char *argv[]) */

    Joseph


  4. Re: Incompatibility w/ Openserver 5 and Openserver 6

    On 1 Jun, 17:48, CJ wrote:
    > On Jun 1, 3:25 am, jbol...@sco.com wrote:
    >
    >
    >
    > > On 31 May, 18:30, CJ wrote:

    >
    > > > I support both OS5 and OS6 SCO customers. I tend to build all
    > > > applications on OS5 and distributed to both OS5 and OS6 customers.
    > > > This has always worked until I began using pseudo terminals.

    >
    > > > I have a "shell" that uses pseudo terminals to drive the application
    > > > passed on the command line. When I build on OS5 it works fine. When
    > > > I build on OS6 it works fine. When I build on OS5 but deploy and
    > > > execute on OS6, getpgid() -- used to insure the application is still
    > > > active -- an EPERM (89) is generated by getpgid().


    Joseph,

    This is a bug in the OSR5 ABI that runs on OpenServer 6.
    It will be fixed in the next maintenance pack release due later in
    the
    summer. If you need a fix urgently then please raise the issue
    via your normal support channel.

    Regards,

    John


  5. Re: Incompatibility w/ Openserver 5 and Openserver 6

    On Jun 7, 3:41 am, jbol...@sco.com wrote:
    > On 1 Jun, 17:48, CJ wrote:
    >
    > > On Jun 1, 3:25 am, jbol...@sco.com wrote:

    >
    > > > On 31 May, 18:30, CJ wrote:

    >
    > > > > I support both OS5 and OS6 SCO customers. I tend to build all
    > > > > applications on OS5 and distributed to both OS5 and OS6 customers.
    > > > > This has always worked until I began using pseudo terminals.

    >
    > > > > I have a "shell" that uses pseudo terminals to drive the application
    > > > > passed on the command line. When I build on OS5 it works fine. When
    > > > > I build on OS6 it works fine. When I build on OS5 but deploy and
    > > > > execute on OS6, getpgid() -- used to insure the application is still
    > > > > active -- an EPERM (89) is generated by getpgid().

    >
    > Joseph,
    >
    > This is a bug in the OSR5 ABI that runs on OpenServer 6.
    > It will be fixed in the next maintenance pack release due later in
    > the
    > summer. If you need a fix urgently then please raise the issue
    > via your normal support channel.
    >
    > Regards,
    >
    > John


    Thanks, John.


+ Reply to Thread