X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-Recipient: djgpp AT delorie DOT com ARC-Seal: i=1; a=rsa-sha256; t=1624278419; cv=none; d=zohomail.com; s=zohoarc; b=Y3HJY0ipUiWJPYOQjYKjVH+rWrA55tvkUnOoNBEv3Ohqn8ETYoquGElCxw7RMxbOP218K2TYG5tafaFlmU2VA9u0gtrjAuj4ea/1bC0qs1IP00d8wzD+0VIxCjwR3JxSO3vzSG7ps5CP9PY2clmak13q2lNw7et6WpGWBR9W1tY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1624278419; h=Content-Type:Date:From:MIME-Version:Message-ID:Subject:To; bh=gxUFslDyprwXNXz2xJHVFRdbV0XOLPFB7G/mLUypqbo=; b=TGi1SB4v3w5wgdwFDrZXP/DFoNIq+O0EnXI9xF3hIKf9+jw0HZpC+FtG+wfQ6vgvqIXdbkrQytK9dBugm6PI5IW8EhREuMxJcB1btxqhCd4dTM/8nhKAJIFjzgUo5X2lMNzz5q/0owfgX5xK+fVzZ1nhIgADqaK85hTpIICBm7U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=zoho.com; spf=pass smtp.mailfrom=dufresnep AT zoho DOT com; dmarc=pass header.from= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=zapps768; d=zoho.com; h=date:from:to:message-id:in-reply-to:subject:mime-version:content-type:user-agent; b=m4EHAzzMu+LMWMKNofZcnSLuTZcE/bURhncXURiCEjsY5+dZl7eNyJJRjCczEJxfIjKMa0oFJNOc fP+OjSnh+hp0qE5wg9YiSvabJJGV6vXWPhcdbqJH3UuxwIzJTATi X-Original-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1624278419; s=zm2020; d=zoho.com; i=dufresnep AT zoho DOT com; h=Date:From:To:Message-Id:In-Reply-To:Subject:MIME-Version:Content-Type; bh=gxUFslDyprwXNXz2xJHVFRdbV0XOLPFB7G/mLUypqbo=; b=PEBR/bRYGcrZPxAksnnszM6bcLMDQUssICigZ/SNXQ9ChgJqAQJi27YJ/zEgyZ9I +x8MzATQ+4WxwjU2rZF/MDYsAg9WSE4i76R+DwozFr6e09MnK29tSBOvx6UXYn0nKbb kiNTV8Lok//m/8WUVJuvm+gSNIZRJbgyMdLkvr54= Date: Mon, 21 Jun 2021 08:26:53 -0400 From: "Paul Dufresne (dufresnep AT zoho DOT com) [via djgpp AT delorie DOT com]" To: "djgpp" Message-Id: <17a2e89b1d2.1044467a864026.4287440461235414665@zoho.com> In-Reply-To: Subject: sys/select.h missing for pth.h (pthread) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_176021_1045841627.1624278413778" Importance: Medium User-Agent: Zoho Mail X-Mailer: Zoho Mail Reply-To: djgpp AT delorie DOT com ------=_Part_176021_1045841627.1624278413778 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Goal: recompile http://ftp.gnu.org/gnu/chess/gnuchess-6.2.8.tar.gz in Linux= for FreeDOS project. Subgoal: Compile the following program taken from: https://man7.org/linux/man-pages/= man3/pthread_sigmask.3.html =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 //#include =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 #include =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 #include =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 #include =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 #include =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 #include =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 #include =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* Simple error handling functions */ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 #define handle_error_en(en, msg) \ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 do { errno =3D en; perror(msg); exit(EXIT_FAILURE); } while (0) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 static void * =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 sig_thread(void *arg) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 { =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 sigset_t *set = =3D arg; =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 int s, sig; =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 for (;;) { =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 s =3D sigwait(set, &sig); =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 if (s !=3D 0) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 handle_error_en(s, "sigwait"); =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 printf("Signal handling thread got signal %d\n", sig); =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 int =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 main(int argc, char *argv[]) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 { =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pthread_t thre= ad; =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 sigset_t set;h= ttps://github.com/jwt27/build-gcc =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 int s; =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* Block SIGQU= IT and SIGUSR1; other threads created by main() =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 will inherit a copy of the signal mask. */ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 sigemptyset(&s= et); =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 sigaddset(&set= , SIGQUIT); =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 sigaddset(&set= , SIGUSR1); =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 s =3D pthread_= sigmask(SIG_BLOCK, &set, NULL); =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (s !=3D 0) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 handle_error_en(s, "pthread_sigmask"); =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 s =3D pthread_= create(&thread, NULL, &sig_thread, &set); =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (s !=3D 0) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 handle_error_en(s, "pthread_create"); =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* Main thread= carries on to create other threads and/or do =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 other work. */ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pause();=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* Dummy pause= so we can test program */ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D I changed #include to I might still be confused between pthread.h and pth.h. I use: https://github.com/jwt27/build-gcc with PREFIX=3D/home/paul/opt/cros= s I have unzip http://www.delorie.com/pub/djgpp/current/v2gnu/pth207b.zip in = a temporary dir I have copied: /pth/lib/ into /home/paul/opt/cross/i386-pc-msdosdjgpp/lib/ adjusting lastl line of .la files to that directory. I have copied pth.h and pthread.h to: /home/paul/opt/cross/i386-pc-msdosdjg= pp/sys-include/ While trying to compile subgoal program: I just commented out #include line= not working in pth.h... except for sys/select: I finished to download it from: https://code.woboq.o= rg/qt5/include/sys/select.h.html paul AT kasparno:~/sigset$ i386-pc-msdosdjgpp-gcc sigset.c -lpthread -lpth In file included from sigset.c:2: /home/paul/opt/cross/i386-pc-msdosdjgpp/sys-include/pth.h:43:10: fatal erro= r: sys/wtime.h: No such file or directory =C2=A0=C2=A0 43 | #include =C2=A0=C2=A0=C2=A0=C2=A0 /* for str= uct timespec */ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 ^~~~~~~~~~~~~ compilation terminated. paul AT kasparno:~/sigset$ i386-pc-msdosdjgpp-gcc sigset.c -lpthread -lpth In file included from sigset.c:2: /home/paul/opt/cross/i386-pc-msdosdjgpp/sys-include/pth.h:45:10: fatal erro= r: sys/socket.h: No such file or directory =C2=A0=C2=A0 45 | #include =C2=A0=C2=A0=C2=A0 /* for sockaddr= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 */ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 ^~~~~~~~~~~~~~ compilation terminated. paul AT kasparno:~/sigset$ i386-pc-msdosdjgpp-gcc sigset.c -lpthread -lpth In file included from /home/paul/opt/cross/i386-pc-msdosdjgpp/sys-include/p= th.h:47, =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 from sigset.c:2: /home/paul/opt/cross/i386-pc-msdosdjgpp/sys-include/sys/select.h:21:10: fat= al error: features.h: No such file or directory =C2=A0=C2=A0 21 | #include =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 ^~~~~~~~~~~~ compilation terminated. paul AT kasparno:~/sigset$=20 So, the sys/select.h (that I put in /home/paul/opt/cross/i386-pc-msdosdjgpp= /sys-include/sys/ ). That's where I am at for now... asking here for help. ------=_Part_176021_1045841627.1624278413778 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable =
Goal: recompile http://ftp.gnu.org/gnu/chess= /gnuchess-6.2.8.tar.gz in Linux for FreeDOS project.

=
Subgoal:
Compile the following program taken from:= https://man7.org/linux/man-pages/man3/pthread_sigmask.3.ht= ml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
      //#include <pthread.h>
=
       #include <pth.h>
<= div>       #include <stdio.h>
=
       #include <stdlib.h>
       #include <unistd.h>
       #include <signal.h>
=
       #include <errno.h>

       /* Simple e= rror handling functions */

   &= nbsp;   #define handle_error_en(en, msg) \
 &n= bsp;            = ; do { errno =3D en; perror(msg); exit(EXIT_FAILURE); } while (0)
=

       static void *
<= /div>
       sig_thread(void *arg)
       {
  &n= bsp;        sigset_t *set =3D arg;
           int s= , sig;

      &nb= sp;    for (;;) {
    &nbs= p;          s =3D sigwait(set,= &sig);
        &= nbsp;      if (s !=3D 0)
  = ;            &n= bsp;    handle_error_en(s, "sigwait");
 &= nbsp;           &nbs= p; printf("Signal handling thread got signal %d\n", sig);
&nb= sp;          }
&= nbsp;      }

 &n= bsp;     int
    &nbs= p;  main(int argc, char *argv[])
    = ;   {
       &nb= sp;   pthread_t thread;
    &nb= sp;      sigset_t set;https://github.com/jwt27/build-gcc=
          = int s;

      &n= bsp;    /* Block SIGQUIT and SIGUSR1; other threads created = by main()
        &nb= sp;     will inherit a copy of the signal mask. */
<= /div>

        &n= bsp;  sigemptyset(&set);
    &nb= sp;      sigaddset(&set, SIGQUIT);
           sigaddset(&= amp;set, SIGUSR1);
       =     s =3D pthread_sigmask(SIG_BLOCK, &set, NULL);
           if (s = !=3D 0)
         = ;      handle_error_en(s, "pthread_sigmask");
<= /div>

        &n= bsp;  s =3D pthread_create(&thread, NULL, &sig_thread, &se= t);
         &nb= sp; if (s !=3D 0)
       &= nbsp;       handle_error_en(s, "pthread_creat= e");

       = ;    /* Main thread carries on to create other threads and/o= r do
         &n= bsp;    other work. */

 &n= bsp;         pause();  &n= bsp;         /* Dummy pause so we c= an test program */
       }
=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
I changed = #include <pthread.h> to <pth.h>
I might still be = confused between pthread.h and pth.h.

I use: <= a target=3D"_blank" href=3D"https://github.com/jwt27/build-gcc">https://git= hub.com/jwt27/build-gcc with PREFIX=3D/home/paul/opt/cross


=
I have copied: /pth/lib/ into /home/paul/opt/cross/i386-pc-msdosdjgpp/= lib/
adjusting lastl line of .la files to that directory.
=

I have copied pth.h and pthread.h to: /home/paul/= opt/cross/i386-pc-msdosdjgpp/sys-include/

Whil= e trying to compile subgoal program: I just commented out #include line not= working in pth.h...
except for sys/select: I finished to dow= nload it from: https://code.woboq.org/qt5/include/sys/select.h.html=

paul AT kasparno:~/sigset$ i386-pc-msdosdjgp= p-gcc sigset.c -lpthread -lpth
In file included from sigset.c= :2:
/home/paul/opt/cross/i386-pc-msdosdjgpp/sys-include/pth.h= :43:10: fatal error: sys/wtime.h: No such file or directory
&= nbsp;  43 | #include <sys/wtime.h>     /* fo= r struct timespec */
      | &n= bsp;        ^~~~~~~~~~~~~
= compilation terminated.
paul AT kasparno:~/sigset$ i386-pc-msdos= djgpp-gcc sigset.c -lpthread -lpth
In file included from sigs= et.c:2:
/home/paul/opt/cross/i386-pc-msdosdjgpp/sys-include/p= th.h:45:10: fatal error: sys/socket.h: No such file or directory
<= div>   45 | #include <sys/socket.h>    /* fo= r sockaddr        */
 = ;     |        =   ^~~~~~~~~~~~~~
compilation terminated.
p= aul AT kasparno:~/sigset$ i386-pc-msdosdjgpp-gcc sigset.c -lpthread -lpth
<= /div>
In file included from /home/paul/opt/cross/i386-pc-msdosdjgpp/sys= -include/pth.h:47,
       =           from sigset.c:2:
=
/home/paul/opt/cross/i386-pc-msdosdjgpp/sys-include/sys/select.h= :21:10: fatal error: features.h: No such file or directory
&n= bsp;  21 | #include <features.h>
   = ;   |          ^~~~~= ~~~~~~~
compilation terminated.
paul AT kasparno:~= /sigset$

So, the sys/select.h (that I put in = /home/paul/opt/cross/i386-pc-msdosdjgpp/sys-include/sys/ ).
<= br>
That's where I am at for now... asking here for help.

------=_Part_176021_1045841627.1624278413778--