status = getrlimit (RLIMIT_FSIZE, &fsize); if (status < 0) return -1;   return fsize.rlim_cur / 512; } case 2:
case UL_SETFSIZE:
__ulimit (cmd, newlimit)     int cmd;     long int newlimit;{  int status;  switch (cmd)    {    case 1:      {	/* Get limit on file size.  */	struct rlimit fsize;	status = getrlimit (RLIMIT_FSIZE, &fsize);	if (status < 0)	  return -1;	/* Convert from bytes to 512 byte units.  */	return fsize.rlim_cur / 512;      }    case 2:      /* Set limit on file size.  */      {	struct rlimit fsize;	fsize.rlim_cur = newlimit * 512;	fsize.rlim_max = newlimit * 512;	return setrlimit (RLIMIT_FSIZE, &fsize);      }    case 4:      return sysconf (_SC_OPEN_MAX);    default:      __set_errno (EINVAL);      return -1;    }}