Пример #1
0
int
__gnat_mkdir (char *dir_name, int encoding ATTRIBUTE_UNUSED)
{
#if defined (__vxworks)

  /* Pretend that the system mkdir is posix compliant even though it
     sometimes is not, not expecting the second argument in some
     configurations (e.g. vxworks 653 2.2, difference from 2.5). The
     second actual argument will just be ignored in this case.  */

  typedef int posix_mkdir (const char * name, mode_t mode);

  posix_mkdir * vxmkdir = (posix_mkdir *)&mkdir;
  return vxmkdir (dir_name, S_IRWXU | S_IRWXG | S_IRWXO);

#elif defined (__MINGW32__)
  TCHAR wname [GNAT_MAX_PATH_LEN + 2];

  if (encoding == Encoding_Unspecified)
    S2WSC (wname, dir_name, GNAT_MAX_PATH_LEN);
  else if (encoding == Encoding_UTF8)
    S2WSU (wname, dir_name, GNAT_MAX_PATH_LEN);
  else
    S2WS (wname, dir_name, GNAT_MAX_PATH_LEN);

  return _tmkdir (wname);
#else
  return mkdir (dir_name, S_IRWXU | S_IRWXG | S_IRWXO);
#endif
}
Пример #2
0
int
__gnat_mkdir (char *dir_name, int encoding ATTRIBUTE_UNUSED)
{
#if defined (__vxworks) && !(defined (__RTP__) && (_WRS_VXWORKS_MINOR != 0))
  return mkdir (dir_name);
#elif defined (__MINGW32__)
  TCHAR wname [GNAT_MAX_PATH_LEN + 2];

  if (encoding == Encoding_Unspecified)
    S2WSC (wname, dir_name, GNAT_MAX_PATH_LEN);
  else if (encoding == Encoding_UTF8)
    S2WSU (wname, dir_name, GNAT_MAX_PATH_LEN);
  else
    S2WS (wname, dir_name, GNAT_MAX_PATH_LEN);

  return _tmkdir (wname);
#else
  return mkdir (dir_name, S_IRWXU | S_IRWXG | S_IRWXO);
#endif
}