xref: /AOO41X/main/sal/osl/os2/dllentry.c (revision 647f063d49501903f1667b75f5634541fc603283)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #include "system.h"
25 #include "sockimpl.h"
26 #include "secimpl.h"
27 //#include "daemimpl.h"
28 
29 #include <osl/diagnose.h>
30 
31 #ifndef GCC
_DLL_InitTerm(sal_uInt32 nModule,sal_uInt32 nFlag)32 sal_uInt32 _System _DLL_InitTerm( sal_uInt32 nModule,
33                                      sal_uInt32 nFlag )
34 {
35     switch( nFlag )
36     {
37         case 0:
38         {
39             /* initialize C runtime library */
40             _CRT_init();
41             {
42                 LONG fhToAdd = 0;
43                 ULONG fhOld = 0;
44                 ULONG ngLastError = DosSetRelMaxFH(&fhToAdd, &fhOld);
45                 if (fhOld < 200)
46                     ngLastError = DosSetMaxFH(200);
47             }
48 
49             /* turn off hardware-errors and exception popups */
50             DosError(FERR_DISABLEHARDERR | FERR_DISABLEEXCEPTION);
51 
52             break;
53         }
54 
55         case 1:
56         {
57             /* unload libs (sockets) */
58             ImplFreeTCPIP();
59 
60             /* unload libs (security) */
61             ImplFreeUPM();
62 
63             break;
64         }
65     }
66 
67     return (sal_True);
68 }
69 #endif
70 
71 
72