Deleted Added
full compact
ibcs2_stat.c (229272) ibcs2_stat.c (274476)
1/*-
2 * Copyright (c) 1995 Scott Bartram
3 * Copyright (c) 1995 Steven Wallace
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 13 unchanged lines hidden (view full) ---

22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1995 Scott Bartram
3 * Copyright (c) 1995 Steven Wallace
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 13 unchanged lines hidden (view full) ---

22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#include <sys/cdefs.h>
30__FBSDID("$FreeBSD: head/sys/i386/ibcs2/ibcs2_stat.c 229272 2012-01-02 12:12:10Z ed $");
30__FBSDID("$FreeBSD: head/sys/i386/ibcs2/ibcs2_stat.c 274476 2014-11-13 18:01:51Z kib $");
31
32#include <sys/param.h>
33#include <sys/systm.h>
34#include <sys/namei.h>
31
32#include <sys/param.h>
33#include <sys/systm.h>
34#include <sys/namei.h>
35#include <sys/fcntl.h>
35#include <sys/file.h>
36#include <sys/stat.h>
37#include <sys/filedesc.h>
38#include <sys/jail.h>
39#include <sys/kernel.h>
40#include <sys/mount.h>
41#include <sys/malloc.h>
42#include <sys/vnode.h>

--- 97 unchanged lines hidden (view full) ---

140{
141 struct ibcs2_stat ibcs2_st;
142 struct stat st;
143 char *path;
144 int error;
145
146 CHECKALTEXIST(td, uap->path, &path);
147
36#include <sys/file.h>
37#include <sys/stat.h>
38#include <sys/filedesc.h>
39#include <sys/jail.h>
40#include <sys/kernel.h>
41#include <sys/mount.h>
42#include <sys/malloc.h>
43#include <sys/vnode.h>

--- 97 unchanged lines hidden (view full) ---

141{
142 struct ibcs2_stat ibcs2_st;
143 struct stat st;
144 char *path;
145 int error;
146
147 CHECKALTEXIST(td, uap->path, &path);
148
148 error = kern_stat(td, path, UIO_SYSSPACE, &st);
149 error = kern_statat(td, 0, AT_FDCWD, path, UIO_SYSSPACE, &st, NULL);
149 free(path, M_TEMP);
150 if (error)
151 return (error);
152 bsd_stat2ibcs_stat(&st, &ibcs2_st);
153 return copyout((caddr_t)&ibcs2_st, (caddr_t)uap->st,
154 ibcs2_stat_len);
155}
156

--- 4 unchanged lines hidden (view full) ---

161{
162 struct ibcs2_stat ibcs2_st;
163 struct stat st;
164 char *path;
165 int error;
166
167 CHECKALTEXIST(td, uap->path, &path);
168
150 free(path, M_TEMP);
151 if (error)
152 return (error);
153 bsd_stat2ibcs_stat(&st, &ibcs2_st);
154 return copyout((caddr_t)&ibcs2_st, (caddr_t)uap->st,
155 ibcs2_stat_len);
156}
157

--- 4 unchanged lines hidden (view full) ---

162{
163 struct ibcs2_stat ibcs2_st;
164 struct stat st;
165 char *path;
166 int error;
167
168 CHECKALTEXIST(td, uap->path, &path);
169
169 error = kern_lstat(td, path, UIO_SYSSPACE, &st);
170 error = kern_statat(td, AT_SYMLINK_NOFOLLOW, AT_FDCWD, path,
171 UIO_SYSSPACE, &st, NULL);
170 free(path, M_TEMP);
171 if (error)
172 return (error);
173 bsd_stat2ibcs_stat(&st, &ibcs2_st);
174 return copyout((caddr_t)&ibcs2_st, (caddr_t)uap->st,
175 ibcs2_stat_len);
176}
177

--- 59 unchanged lines hidden ---
172 free(path, M_TEMP);
173 if (error)
174 return (error);
175 bsd_stat2ibcs_stat(&st, &ibcs2_st);
176 return copyout((caddr_t)&ibcs2_st, (caddr_t)uap->st,
177 ibcs2_stat_len);
178}
179

--- 59 unchanged lines hidden ---