/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        T E S T   D E   L A   F O N C T I O N   ' fcntl(...) '  :                                                                  */
/*                                                                                                                                   */
/*                                                                                                                                   */
/*        Author of '$xtc/files.11$c' :                                                                                              */
/*                                                                                                                                   */
/*                    Jean-Francois Colonna (LACTAMME, AAAAMMJJhhmmss).                                                              */
/*                                                                                                                                   */
/*************************************************************************************************************************************/

#include  <stdio.h>
#include  <fcntl.h>

#define   ENTREE                                                                                                                        \
                    0

main()
     {
     printf("\n RDONLY=%04x",O_RDONLY);
     printf("\n WRONLY=%04x",O_WRONLY);
     printf("\n RDWR  =%04x",O_RDWR);
     printf("\n TRUNC =%04x",O_TRUNC);

     printf("\n flags=%08x\n",fcntl(ENTREE,F_GETFL));
                                        /* On obtient les resultats suivants :                                                       */
                                        /*                                                                                           */
                                        /*        $aPout                                                      flags=O_RDWR           */
                                        /*                                                                                           */
                                        /* et :                                                                                      */
                                        /*                                                                                           */
                                        /*        echo "" | $aPout                                            flags=O_RDONLY         */
                                        /*                                                                                           */
                                        /* et :                                                                                      */
                                        /*                                                                                           */
                                        /*        ... | $xcg/remote.01$X machine=... c="tests/c$D/$aPout"     flags=O_RDONLY+O_TRUNC */
                                        /*                                                                                           */
                                        /* mais ce dernier cas sur '$LACT29' uniquement...                                           */
     }



Copyright © Jean-François Colonna, 2021-2023.
Copyright © CMAP (Centre de Mathématiques APpliquées) UMR CNRS 7641 / École polytechnique, Institut Polytechnique de Paris, 2021-2023.