1 /******************************************************************************
2  *
3  * Copyright 2007-2008 Samuel Thibault <samuel.thibault@eu.citrix.com>.
4  * All rights reserved.
5  * Use is subject to license terms.
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation;
10  * version 2.1 of the License.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #undef NDEBUG
22 #include <mini-os/types.h>
23 #include <mini-os/os.h>
24 #include <mini-os/mm.h>
25 #include <mini-os/lib.h>
26 
27 #include <xen/memory.h>
28 #include <unistd.h>
29 #include <fcntl.h>
30 #include <stdio.h>
31 #include <assert.h>
32 #include <stdint.h>
33 #include <inttypes.h>
34 #include <malloc.h>
35 
36 #include "xc_private.h"
37 
38 void minios_interface_close_fd(int fd);
39 
40 extern void minios_interface_close_fd(int fd);
41 
minios_interface_close_fd(int fd)42 void minios_interface_close_fd(int fd)
43 {
44     files[fd].type = FTYPE_NONE;
45 }
46 
47 /* Optionally flush file to disk and discard page cache */
discard_file_cache(xc_interface * xch,int fd,int flush)48 void discard_file_cache(xc_interface *xch, int fd, int flush)
49 {
50     if (flush)
51         fsync(fd);
52 }
53 
xc_memalign(xc_interface * xch,size_t alignment,size_t size)54 void *xc_memalign(xc_interface *xch, size_t alignment, size_t size)
55 {
56     return memalign(alignment, size);
57 }
58 
59 /*
60  * Local variables:
61  * mode: C
62  * c-file-style: "BSD"
63  * c-basic-offset: 4
64  * tab-width: 4
65  * indent-tabs-mode: nil
66  * End:
67  */
68