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

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

#define   SORTIE                                                                                                                        \
                    1

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(SORTIE,F_GETFL));
                                        /* On obtient les resultats suivants :                                                       */
                                        /*                                                                                           */
                                        /*        $aPout                                            flags=O_RDWR                     */
                                        /*                                                                                           */
                                        /* et :                                                                                      */
                                        /*                                                                                           */
                                        /*        $aPout | $CA                                      flags=O_WRONLY                   */
                                        /*                                                                                           */
                                        /* et :                                                                                      */
                                        /*                                                                                           */
                                        /*        $aPout > ...                                      flags=0x8000+O_WRONLY            */
                                        /*                                                                                           */
     }



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.