2

I'm porting some C++ code from UNIX to Windows which detects the occurrence of the EDQUOT error, which indicates that there was an unsuccessful attempt to exceed the current user's disk quota. Visual Studio's <errno.h> doesn't have an EDQUOT, although I know that Windows has disk quota functionality. Visual Studio's <errno.h> does have an ENOSPC, which might be how the CRT expresses what UNIX would express as EDQUOT. Can anybody confirm or deny this theory? And if this isn't the way to handle this, what is?

Integer Poet
  • 747
  • 5
  • 19
  • The runtime library sources show ENOSPC being produced in exactly one place, unsurprisingly in 'write'. If the Windows system call WriteFile fails to write any bytes, one of three branches occurs. – Integer Poet May 01 '09 at 19:23
  • If there was a Win32 error, it is mapped and returned. You might expect NT_STATUS_QUOTA_EXCEEDED to map to EDQUOT, or for that matter anything at all, but it does not. The second branch is about devices and can be ignored. The third branch is everything else, which produces ENOSPC. – Integer Poet May 01 '09 at 19:25
  • Please ignore my comment above about NT_STATUS_QUOTA_EXCEEDED; that must be a kernel error code, not a Win32 error code. There are all kinds of quota-related error codes at the Win32 level, and I'm afraid I'm going to have to write code to see which of them appears under what circumstances so I can figure out what effect they may have on CRT. One thing that worries me is that CRT doesn't seem to map any disk quota errors onto anything and falls back to EINVAL. – Integer Poet May 01 '09 at 19:36

1 Answers1

2

C:\Program Files\Microsoft SDKs\Windows\v7.0A\Include\WinSock.h

C:\Program Files\Microsoft SDKs\Windows\v7.1\Include\WinSock.h

#if 0
#define EDQUOT                  WSAEDQUOT
#endif

C:\Program Files\Microsoft SDKs\Windows\v7.0A\Include\WinError.h

C:\Program Files\Microsoft SDKs\Windows\v7.1\Include\WinError.h

//
// MessageId: WSAEDQUOT
//
// MessageText:
//
// Ran out of disk quota.
//
#define WSAEDQUOT                        10069L
plan9assembler
  • 2,862
  • 1
  • 24
  • 13