Updated formatting + indentation.
@@ -22,8 +22,8 @@ static const char id[]="$Id: tpl.c 107 2007-04-20 17:11:29Z thanson $";
* @param offset offset into mapped object
* @return pointer to the memory region, or NULL in case of error
*/
-void *mmap(void *addr, unsigned int len, int prot, int flags, int fd, unsigned int offset)
-{
+void *
+mmap (void *addr, unsigned int len, int prot, int flags, int fd, unsigned int offset) {
DWORD wprot;
DWORD waccess;
HANDLE h;
@@ -124,12 +124,11 @@ void *mmap(void *addr, unsigned int len, int prot, int flags, int fd, unsigned i
* @param len length of the region
* @return 0 for success, -1 for error
*/
-int munmap(void *addr, int len)
-{
+int
+munmap (void *addr, int len) {
if (UnmapViewOfFile (addr)) {
return 0;
- }
- else {
+ } else {
errno = EINVAL;
return -1;
}
@@ -146,8 +145,8 @@ int munmap(void *addr, int len)
* @param flags sync options -- currently ignored
* @return 0 for success, -1 for error
*/
-int msync(char *addr, int len, int flags)
-{
+int
+msync (char *addr, int len, int flags) {
if (FlushViewOfFile (addr, len) == 0) {
DWORD error = GetLastError ();
