Print this page
104 Bring back lx brand
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/brand/solaris10/s10_brand.c
+++ new/usr/src/uts/common/brand/solaris10/s10_brand.c
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 23 * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
24 24 */
25 25
26 26 #include <sys/errno.h>
27 27 #include <sys/exec.h>
28 28 #include <sys/file.h>
29 29 #include <sys/kmem.h>
30 30 #include <sys/modctl.h>
31 31 #include <sys/model.h>
32 32 #include <sys/proc.h>
33 33 #include <sys/syscall.h>
34 34 #include <sys/systm.h>
35 35 #include <sys/thread.h>
36 36 #include <sys/cmn_err.h>
37 37 #include <sys/archsystm.h>
38 38 #include <sys/pathname.h>
39 39 #include <sys/sunddi.h>
40 40
41 41 #include <sys/machbrand.h>
42 42 #include <sys/brand.h>
43 43 #include "s10_brand.h"
44 44
45 45 char *s10_emulation_table = NULL;
46 46
47 47 void s10_init_brand_data(zone_t *);
48 48 void s10_free_brand_data(zone_t *);
49 49 void s10_setbrand(proc_t *);
50 50 int s10_getattr(zone_t *, int, void *, size_t *);
51 51 int s10_setattr(zone_t *, int, void *, size_t);
52 52 int s10_brandsys(int, int64_t *, uintptr_t, uintptr_t, uintptr_t,
53 53 uintptr_t, uintptr_t, uintptr_t);
54 54 void s10_copy_procdata(proc_t *, proc_t *);
55 55 void s10_proc_exit(struct proc *, klwp_t *);
56 56 void s10_exec();
57 57 int s10_initlwp(klwp_t *);
58 58 void s10_forklwp(klwp_t *, klwp_t *);
59 59 void s10_freelwp(klwp_t *);
60 60 void s10_lwpexit(klwp_t *);
61 61 int s10_elfexec(vnode_t *, execa_t *, uarg_t *, intpdata_t *, int,
62 62 long *, int, caddr_t, cred_t *, int);
63 63 void s10_sigset_native_to_s10(sigset_t *);
64 64 void s10_sigset_s10_to_native(sigset_t *);
65 65
66 66 /* s10 brand */
67 67 struct brand_ops s10_brops = {
68 68 s10_init_brand_data,
69 69 s10_free_brand_data,
70 70 s10_brandsys,
71 71 s10_setbrand,
72 72 s10_getattr,
73 73 s10_setattr,
74 74 s10_copy_procdata,
75 75 s10_proc_exit,
76 76 s10_exec,
77 77 lwp_setrval,
78 78 s10_initlwp,
79 79 s10_forklwp,
80 80 s10_freelwp,
81 81 s10_lwpexit,
82 82 s10_elfexec,
83 83 s10_sigset_native_to_s10,
84 84 s10_sigset_s10_to_native,
85 85 S10_NSIG,
86 86 };
87 87
88 88 #ifdef sparc
89 89
90 90 struct brand_mach_ops s10_mops = {
↓ open down ↓ |
90 lines elided |
↑ open up ↑ |
91 91 s10_brand_syscall_callback,
92 92 s10_brand_syscall32_callback
93 93 };
94 94
95 95 #else /* sparc */
96 96
97 97 #ifdef __amd64
98 98
99 99 struct brand_mach_ops s10_mops = {
100 100 s10_brand_sysenter_callback,
101 + NULL,
101 102 s10_brand_int91_callback,
102 103 s10_brand_syscall_callback,
103 - s10_brand_syscall32_callback
104 + s10_brand_syscall32_callback,
105 + NULL
104 106 };
105 107
106 108 #else /* ! __amd64 */
107 109
108 110 struct brand_mach_ops s10_mops = {
109 111 s10_brand_sysenter_callback,
110 112 NULL,
113 + NULL,
111 114 s10_brand_syscall_callback,
115 + NULL,
112 116 NULL
113 117 };
114 118 #endif /* __amd64 */
115 119
116 120 #endif /* _sparc */
117 121
118 122 struct brand s10_brand = {
119 123 BRAND_VER_1,
120 124 "solaris10",
121 125 &s10_brops,
122 126 &s10_mops
123 127 };
124 128
125 129 static struct modlbrand modlbrand = {
126 130 &mod_brandops, /* type of module */
127 131 "Solaris 10 Brand", /* description of module */
128 132 &s10_brand /* driver ops */
129 133 };
130 134
131 135 static struct modlinkage modlinkage = {
132 136 MODREV_1, (void *)&modlbrand, NULL
133 137 };
134 138
135 139 void
136 140 s10_setbrand(proc_t *p)
137 141 {
138 142 brand_solaris_setbrand(p, &s10_brand);
139 143 }
140 144
141 145 /*ARGSUSED*/
142 146 int
143 147 s10_getattr(zone_t *zone, int attr, void *buf, size_t *bufsize)
144 148 {
145 149 ASSERT(zone->zone_brand == &s10_brand);
146 150 if (attr == S10_EMUL_BITMAP) {
147 151 if (buf == NULL || *bufsize != sizeof (s10_emul_bitmap_t))
148 152 return (EINVAL);
149 153 if (copyout(((s10_zone_data_t *)zone->zone_brand_data)->
150 154 emul_bitmap, buf, sizeof (s10_emul_bitmap_t)) != 0)
151 155 return (EFAULT);
152 156 return (0);
153 157 }
154 158
155 159 return (EINVAL);
156 160 }
157 161
158 162 int
159 163 s10_setattr(zone_t *zone, int attr, void *buf, size_t bufsize)
160 164 {
161 165 ASSERT(zone->zone_brand == &s10_brand);
162 166 if (attr == S10_EMUL_BITMAP) {
163 167 if (buf == NULL || bufsize != sizeof (s10_emul_bitmap_t))
164 168 return (EINVAL);
165 169 if (copyin(buf, ((s10_zone_data_t *)zone->zone_brand_data)->
166 170 emul_bitmap, sizeof (s10_emul_bitmap_t)) != 0)
167 171 return (EFAULT);
168 172 return (0);
169 173 }
170 174
171 175 return (EINVAL);
172 176 }
173 177
174 178 #ifdef __amd64
175 179 /*
176 180 * The Nevada kernel clears %fs for threads in 64-bit x86 processes but S10's
177 181 * libc expects %fs to be nonzero. This causes some committed
178 182 * libc/libthread interfaces (e.g., thr_main()) to fail, which impacts several
179 183 * libraries, including libdoor. This function sets the specified LWP's %fs
180 184 * register to the legacy S10 selector value (LWPFS_SEL).
181 185 *
182 186 * The best solution to the aforementioned problem is backporting CRs
183 187 * 6467491 to Solaris 10 so that 64-bit x86 Solaris 10 processes
184 188 * would accept zero for %fs. Backporting the CRs is a requirement for running
185 189 * S10 Containers in PV domUs because 64-bit Xen clears %fsbase when %fs is
186 190 * nonzero. Such behavior breaks 64-bit processes because Xen has to fetch the
187 191 * FS segments' base addresses from the LWPs' GDTs, which are only capable of
188 192 * 32-bit addressing.
189 193 */
190 194 /*ARGSUSED*/
191 195 static void
192 196 s10_amd64_correct_fsreg(klwp_t *l)
193 197 {
194 198 if (lwp_getdatamodel(l) == DATAMODEL_NATIVE) {
195 199 kpreempt_disable();
196 200 l->lwp_pcb.pcb_fs = LWPFS_SEL;
197 201 l->lwp_pcb.pcb_rupdate = 1;
198 202 lwptot(l)->t_post_sys = 1; /* Guarantee update_sregs() */
199 203 kpreempt_enable();
200 204 }
201 205 }
202 206 #endif /* __amd64 */
203 207
204 208 /*
205 209 * Native processes are started with the native ld.so.1 as the command. This
206 210 * brand op is invoked by s10_npreload to fix up the command and arguments
207 211 * so that apps like pgrep or ps see the expected command strings.
208 212 */
209 213 int
210 214 s10_native(void *cmd, void *args)
211 215 {
212 216 struct user *up = PTOU(curproc);
213 217 char cmd_buf[MAXCOMLEN + 1];
214 218 char arg_buf[PSARGSZ];
215 219
216 220 if (copyin(cmd, &cmd_buf, sizeof (cmd_buf)) != 0)
217 221 return (EFAULT);
218 222 if (copyin(args, &arg_buf, sizeof (arg_buf)) != 0)
219 223 return (EFAULT);
220 224
221 225 /*
222 226 * Make sure that the process' interpreter is the native dynamic linker.
223 227 * Convention dictates that native processes executing within solaris10-
224 228 * branded zones are interpreted by the native dynamic linker (the
225 229 * process and its arguments are specified as arguments to the dynamic
226 230 * linker). If this convention is violated (i.e.,
227 231 * brandsys(B_S10_NATIVE, ...) is invoked by a process that shouldn't be
228 232 * native), then do nothing and silently indicate success.
229 233 */
230 234 if (strcmp(up->u_comm, S10_LINKER_NAME) != 0)
231 235 return (0);
232 236
233 237 /*
234 238 * The sizeof has an extra value for the trailing '\0' so this covers
235 239 * the appended " " in the following strcmps.
236 240 */
237 241 if (strncmp(up->u_psargs, BRAND_NATIVE_LINKER64 " ",
238 242 sizeof (BRAND_NATIVE_LINKER64)) != 0 &&
239 243 strncmp(up->u_psargs, BRAND_NATIVE_LINKER32 " ",
240 244 sizeof (BRAND_NATIVE_LINKER32)) != 0)
241 245 return (0);
242 246
243 247 mutex_enter(&curproc->p_lock);
244 248 (void) strlcpy(up->u_comm, cmd_buf, sizeof (up->u_comm));
245 249 (void) strlcpy(up->u_psargs, arg_buf, sizeof (up->u_psargs));
246 250 mutex_exit(&curproc->p_lock);
247 251
248 252 return (0);
249 253 }
250 254
251 255 /*ARGSUSED*/
252 256 int
253 257 s10_brandsys(int cmd, int64_t *rval, uintptr_t arg1, uintptr_t arg2,
254 258 uintptr_t arg3, uintptr_t arg4, uintptr_t arg5, uintptr_t arg6)
255 259 {
256 260 proc_t *p = curproc;
257 261 int res;
258 262
259 263 *rval = 0;
260 264
261 265 if (cmd == B_S10_NATIVE)
262 266 return (s10_native((void *)arg1, (void *)arg2));
263 267
264 268 res = brand_solaris_cmd(cmd, arg1, arg2, arg3, &s10_brand, S10_VERSION);
265 269 if (res >= 0)
266 270 return (res);
267 271
268 272 switch ((cmd)) {
269 273 case B_S10_PIDINFO:
270 274 /*
271 275 * The s10 brand needs to be able to get the pid of the
272 276 * current process and the pid of the zone's init, and it
273 277 * needs to do this on every process startup. Early in
274 278 * brand startup, we can't call getpid() because calls to
275 279 * getpid() represent a magical signal to some old-skool
276 280 * debuggers. By merging all of this into one call, we
277 281 * make this quite a bit cheaper and easier to handle in
278 282 * the brand module.
279 283 */
280 284 if (copyout(&p->p_pid, (void *)arg1, sizeof (pid_t)) != 0)
281 285 return (EFAULT);
282 286 if (copyout(&p->p_zone->zone_proc_initpid, (void *)arg2,
283 287 sizeof (pid_t)) != 0)
284 288 return (EFAULT);
285 289 return (0);
286 290
287 291 case B_S10_ISFDXATTRDIR: {
288 292 /*
289 293 * This subcommand enables the userland brand emulation library
290 294 * to determine whether a file descriptor refers to an extended
291 295 * file attributes directory. There is no standard syscall or
292 296 * libc function that can make such a determination.
293 297 */
294 298 file_t *dir_filep;
295 299
296 300 dir_filep = getf((int)arg1);
297 301 if (dir_filep == NULL)
298 302 return (EBADF);
299 303 ASSERT(dir_filep->f_vnode != NULL);
300 304 *rval = IS_XATTRDIR(dir_filep->f_vnode);
301 305 releasef((int)arg1);
302 306 return (0);
303 307 }
304 308
305 309 #ifdef __amd64
306 310 case B_S10_FSREGCORRECTION:
307 311 /*
308 312 * This subcommand exists so that the SYS_lwp_private and
309 313 * SYS_lwp_create syscalls can manually set the current thread's
310 314 * %fs register to the legacy S10 selector value for 64-bit x86
311 315 * processes.
312 316 */
313 317 s10_amd64_correct_fsreg(ttolwp(curthread));
314 318 return (0);
315 319 #endif /* __amd64 */
316 320 }
317 321
318 322 return (EINVAL);
319 323 }
320 324
321 325 void
322 326 s10_copy_procdata(proc_t *child, proc_t *parent)
323 327 {
324 328 brand_solaris_copy_procdata(child, parent, &s10_brand);
325 329 }
326 330
327 331 void
328 332 s10_proc_exit(struct proc *p, klwp_t *l)
329 333 {
330 334 brand_solaris_proc_exit(p, l, &s10_brand);
331 335 }
332 336
333 337 void
334 338 s10_exec()
335 339 {
336 340 brand_solaris_exec(&s10_brand);
337 341 }
338 342
339 343 int
340 344 s10_initlwp(klwp_t *l)
341 345 {
342 346 return (brand_solaris_initlwp(l, &s10_brand));
343 347 }
344 348
345 349 void
346 350 s10_forklwp(klwp_t *p, klwp_t *c)
347 351 {
348 352 brand_solaris_forklwp(p, c, &s10_brand);
349 353
350 354 #ifdef __amd64
351 355 /*
352 356 * Only correct the child's %fs register if the parent's %fs register
353 357 * is LWPFS_SEL. If the parent's %fs register is zero, then the Solaris
354 358 * 10 environment that we're emulating uses a version of libc that
355 359 * works when %fs is zero (i.e., it contains backports of CRs 6467491
356 360 * and 6501650).
357 361 */
358 362 if (p->lwp_pcb.pcb_fs == LWPFS_SEL)
359 363 s10_amd64_correct_fsreg(c);
360 364 #endif /* __amd64 */
361 365 }
362 366
363 367 void
364 368 s10_freelwp(klwp_t *l)
365 369 {
366 370 brand_solaris_freelwp(l, &s10_brand);
367 371 }
368 372
369 373 void
370 374 s10_lwpexit(klwp_t *l)
371 375 {
372 376 brand_solaris_lwpexit(l, &s10_brand);
373 377 }
374 378
375 379 void
376 380 s10_free_brand_data(zone_t *zone)
377 381 {
378 382 kmem_free(zone->zone_brand_data, sizeof (s10_zone_data_t));
379 383 }
380 384
381 385 void
382 386 s10_init_brand_data(zone_t *zone)
383 387 {
384 388 ASSERT(zone->zone_brand == &s10_brand);
385 389 ASSERT(zone->zone_brand_data == NULL);
386 390 zone->zone_brand_data = kmem_zalloc(sizeof (s10_zone_data_t), KM_SLEEP);
387 391 }
388 392
389 393 int
390 394 s10_elfexec(vnode_t *vp, execa_t *uap, uarg_t *args, intpdata_t *idatap,
391 395 int level, long *execsz, int setid, caddr_t exec_file, cred_t *cred,
392 396 int brand_action)
393 397 {
394 398 return (brand_solaris_elfexec(vp, uap, args, idatap, level, execsz,
395 399 setid, exec_file, cred, brand_action, &s10_brand, S10_BRANDNAME,
396 400 S10_LIB, S10_LIB32, S10_LINKER, S10_LINKER32));
397 401 }
398 402
399 403 void
400 404 s10_sigset_native_to_s10(sigset_t *set)
401 405 {
402 406 int nativesig;
403 407 int s10sig;
404 408 sigset_t s10set;
405 409
406 410 /*
407 411 * Shortcut: we know the first 32 signals are the same in both
408 412 * s10 and native Solaris. Just assign the first word.
409 413 */
410 414 s10set.__sigbits[0] = set->__sigbits[0];
411 415 s10set.__sigbits[1] = 0;
412 416 s10set.__sigbits[2] = 0;
413 417 s10set.__sigbits[3] = 0;
414 418
415 419 /*
416 420 * Copy the remainder of the initial set of common signals.
417 421 */
418 422 for (nativesig = 33; nativesig < S10_SIGRTMIN; nativesig++)
419 423 if (sigismember(set, nativesig))
420 424 sigaddset(&s10set, nativesig);
421 425
422 426 /*
423 427 * Convert any native RT signals to their S10 values.
424 428 */
425 429 for (nativesig = _SIGRTMIN, s10sig = S10_SIGRTMIN;
426 430 nativesig <= _SIGRTMAX && s10sig <= S10_SIGRTMAX;
427 431 nativesig++, s10sig++) {
428 432 if (sigismember(set, nativesig))
429 433 sigaddset(&s10set, s10sig);
430 434 }
431 435
432 436 *set = s10set;
433 437 }
434 438
435 439 void
436 440 s10_sigset_s10_to_native(sigset_t *set)
437 441 {
438 442 int s10sig;
439 443 int nativesig;
440 444 sigset_t nativeset;
441 445
442 446 /*
443 447 * Shortcut: we know the first 32 signals are the same in both
444 448 * s10 and native Solaris. Just assign the first word.
445 449 */
446 450 nativeset.__sigbits[0] = set->__sigbits[0];
447 451 nativeset.__sigbits[1] = 0;
448 452 nativeset.__sigbits[2] = 0;
449 453 nativeset.__sigbits[3] = 0;
450 454
451 455 /*
452 456 * Copy the remainder of the initial set of common signals.
453 457 */
454 458 for (s10sig = 33; s10sig < S10_SIGRTMIN; s10sig++)
455 459 if (sigismember(set, s10sig))
456 460 sigaddset(&nativeset, s10sig);
457 461
458 462 /*
459 463 * Convert any S10 RT signals to their native values.
460 464 */
461 465 for (s10sig = S10_SIGRTMIN, nativesig = _SIGRTMIN;
462 466 s10sig <= S10_SIGRTMAX && nativesig <= _SIGRTMAX;
463 467 s10sig++, nativesig++) {
464 468 if (sigismember(set, s10sig))
465 469 sigaddset(&nativeset, nativesig);
466 470 }
467 471
468 472 *set = nativeset;
469 473 }
470 474
471 475 int
472 476 _init(void)
473 477 {
474 478 int err;
475 479
476 480 /*
477 481 * Set up the table indicating which system calls we want to
478 482 * interpose on. We should probably build this automatically from
479 483 * a list of system calls that is shared with the user-space
480 484 * library.
481 485 */
482 486 s10_emulation_table = kmem_zalloc(NSYSCALL, KM_SLEEP);
483 487 s10_emulation_table[S10_SYS_forkall] = 1; /* 2 */
484 488 s10_emulation_table[S10_SYS_open] = 1; /* 5 */
485 489 s10_emulation_table[S10_SYS_wait] = 1; /* 7 */
486 490 s10_emulation_table[S10_SYS_creat] = 1; /* 8 */
487 491 s10_emulation_table[S10_SYS_link] = 1; /* 9 */
488 492 s10_emulation_table[S10_SYS_unlink] = 1; /* 10 */
489 493 s10_emulation_table[S10_SYS_exec] = 1; /* 11 */
490 494 s10_emulation_table[S10_SYS_mknod] = 1; /* 14 */
491 495 s10_emulation_table[S10_SYS_chmod] = 1; /* 15 */
492 496 s10_emulation_table[S10_SYS_chown] = 1; /* 16 */
493 497 s10_emulation_table[S10_SYS_stat] = 1; /* 18 */
494 498 s10_emulation_table[S10_SYS_umount] = 1; /* 22 */
495 499 s10_emulation_table[S10_SYS_fstat] = 1; /* 28 */
496 500 s10_emulation_table[S10_SYS_utime] = 1; /* 30 */
497 501 s10_emulation_table[S10_SYS_access] = 1; /* 33 */
498 502 s10_emulation_table[SYS_kill] = 1; /* 37 */
499 503 s10_emulation_table[S10_SYS_dup] = 1; /* 41 */
500 504 s10_emulation_table[SYS_ioctl] = 1; /* 54 */
501 505 s10_emulation_table[SYS_execve] = 1; /* 59 */
502 506 s10_emulation_table[SYS_acctctl] = 1; /* 71 */
503 507 s10_emulation_table[S10_SYS_issetugid] = 1; /* 75 */
504 508 s10_emulation_table[S10_SYS_fsat] = 1; /* 76 */
505 509 s10_emulation_table[S10_SYS_rmdir] = 1; /* 79 */
506 510 s10_emulation_table[S10_SYS_mkdir] = 1; /* 80 */
507 511 s10_emulation_table[SYS_getdents] = 1; /* 81 */
508 512 s10_emulation_table[S10_SYS_poll] = 1; /* 87 */
509 513 s10_emulation_table[S10_SYS_lstat] = 1; /* 88 */
510 514 s10_emulation_table[S10_SYS_symlink] = 1; /* 89 */
511 515 s10_emulation_table[S10_SYS_readlink] = 1; /* 90 */
512 516 s10_emulation_table[S10_SYS_fchmod] = 1; /* 93 */
513 517 s10_emulation_table[S10_SYS_fchown] = 1; /* 94 */
514 518 s10_emulation_table[SYS_sigprocmask] = 1; /* 95 */
515 519 s10_emulation_table[SYS_sigsuspend] = 1; /* 96 */
516 520 s10_emulation_table[SYS_sigaction] = 1; /* 98 */
517 521 s10_emulation_table[SYS_sigpending] = 1; /* 99 */
518 522 s10_emulation_table[SYS_waitid] = 1; /* 107 */
519 523 s10_emulation_table[SYS_sigsendsys] = 1; /* 108 */
520 524 #if defined(__x86)
521 525 s10_emulation_table[S10_SYS_xstat] = 1; /* 123 */
522 526 s10_emulation_table[S10_SYS_lxstat] = 1; /* 124 */
523 527 s10_emulation_table[S10_SYS_fxstat] = 1; /* 125 */
524 528 s10_emulation_table[S10_SYS_xmknod] = 1; /* 126 */
525 529 #endif
526 530 s10_emulation_table[S10_SYS_lchown] = 1; /* 130 */
527 531 s10_emulation_table[S10_SYS_rename] = 1; /* 134 */
528 532 s10_emulation_table[SYS_uname] = 1; /* 135 */
529 533 s10_emulation_table[SYS_sysconfig] = 1; /* 137 */
530 534 s10_emulation_table[SYS_systeminfo] = 1; /* 139 */
531 535 s10_emulation_table[S10_SYS_fork1] = 1; /* 143 */
532 536 s10_emulation_table[SYS_sigtimedwait] = 1; /* 144 */
533 537 s10_emulation_table[S10_SYS_lwp_sema_wait] = 1; /* 147 */
534 538 s10_emulation_table[S10_SYS_utimes] = 1; /* 154 */
535 539 s10_emulation_table[SYS_lwp_create] = 1; /* 159 */
536 540 s10_emulation_table[SYS_lwp_kill] = 1; /* 163 */
537 541 s10_emulation_table[SYS_lwp_sigmask] = 1; /* 165 */
538 542 #if defined(__amd64)
539 543 s10_emulation_table[SYS_lwp_private] = 1; /* 166 */
540 544 #endif /* __amd64 */
541 545 s10_emulation_table[S10_SYS_lwp_mutex_lock] = 1; /* 169 */
542 546 s10_emulation_table[SYS_pwrite] = 1; /* 174 */
543 547 s10_emulation_table[SYS_acl] = 1; /* 185 */
544 548 s10_emulation_table[SYS_auditsys] = 1; /* 186 */
545 549 s10_emulation_table[SYS_sigqueue] = 1; /* 190 */
546 550 s10_emulation_table[SYS_facl] = 1; /* 200 */
547 551 s10_emulation_table[SYS_signotify] = 1; /* 205 */
548 552 s10_emulation_table[SYS_lwp_mutex_timedlock] = 1; /* 210 */
549 553 s10_emulation_table[SYS_getdents64] = 1; /* 213 */
550 554 s10_emulation_table[S10_SYS_stat64] = 1; /* 215 */
551 555 s10_emulation_table[S10_SYS_lstat64] = 1; /* 216 */
552 556 s10_emulation_table[S10_SYS_fstat64] = 1; /* 217 */
553 557 s10_emulation_table[SYS_pwrite64] = 1; /* 223 */
554 558 s10_emulation_table[S10_SYS_creat64] = 1; /* 224 */
555 559 s10_emulation_table[S10_SYS_open64] = 1; /* 225 */
556 560 s10_emulation_table[SYS_zone] = 1; /* 227 */
557 561 s10_emulation_table[SYS_lwp_mutex_trylock] = 1; /* 251 */
558 562
559 563 err = mod_install(&modlinkage);
560 564 if (err) {
561 565 cmn_err(CE_WARN, "Couldn't install brand module");
562 566 kmem_free(s10_emulation_table, NSYSCALL);
563 567 }
564 568
565 569 return (err);
566 570 }
567 571
568 572 int
569 573 _info(struct modinfo *modinfop)
570 574 {
571 575 return (mod_info(&modlinkage, modinfop));
572 576 }
573 577
574 578 int
575 579 _fini(void)
576 580 {
577 581 return (brand_solaris_fini(&s10_emulation_table, &modlinkage,
578 582 &s10_brand));
579 583 }
↓ open down ↓ |
458 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX