set the dos error status even if requesters are disabled
[tangerine.git] / rom / dos / unloadseg.c
blob988b6fbaa6613e183e2777adbe01972f5c2533bd
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: english
7 */
9 #include <proto/exec.h>
10 #include <dos/dos.h>
11 #include <exec/types.h>
12 #include "dos_intern.h"
14 extern void Exec_FreeMem();
16 /*****************************************************************************
18 NAME */
19 #include <proto/dos.h>
21 AROS_LH1(BOOL, UnLoadSeg,
23 /* SYNOPSIS */
24 AROS_LHA(BPTR, seglist, D1),
26 /* LOCATION */
27 struct DosLibrary *, DOSBase, 26, Dos)
29 /* FUNCTION
30 Free a segment list allocated with LoadSeg().
32 INPUTS
33 seglist - The segment list.
35 RESULT
36 success = returns whether everything went ok. Returns FALSE if
37 seglist was NULL.
38 NOTES
40 EXAMPLE
42 BUGS
44 SEE ALSO
45 LoadSeg()
47 INTERNALS
49 *****************************************************************************/
51 AROS_LIBFUNC_INIT
53 if (seglist)
55 #if AROS_MODULES_DEBUG
56 extern struct MinList debug_seglist;
57 extern struct MinList free_debug_segnodes;
58 struct debug_segnode *segnode;
60 Forbid();
61 ForeachNode(&debug_seglist, segnode)
63 if (segnode->seglist == seglist)
65 REMOVE(segnode);
66 ADDHEAD(&free_debug_segnodes, segnode);
67 break;
70 Permit();
71 #endif
72 return InternalUnLoadSeg(seglist, __AROS_GETVECADDR(SysBase, 35));
75 return FALSE;
77 AROS_LIBFUNC_EXIT
78 } /* UnLoadSeg */