| 480 | } |
| 481 | |
| 482 | int |
| 483 | alq_open(struct alq **alqp, const char *file, struct ucred *cred, int cmode, |
| 484 | int size, int count) |
| 485 | { |
| 486 | int ret; |
| 487 | |
| 488 | KASSERT((count >= 0), ("%s: count < 0", __func__)); |
| 489 | |
| 490 | if (count > 0) { |
| 491 | if ((ret = alq_open_flags(alqp, file, cred, cmode, |
| 492 | size*count, 0)) == 0) { |
| 493 | (*alqp)->aq_flags |= AQ_LEGACY; |
| 494 | (*alqp)->aq_entmax = count; |
| 495 | (*alqp)->aq_entlen = size; |
| 496 | } |
| 497 | } else |
| 498 | ret = alq_open_flags(alqp, file, cred, cmode, size, 0); |
| 499 | |
| 500 | return (ret); |
| 501 | } |
| 502 | |
| 503 | /* |
| 504 | * Copy a new entry into the queue. If the operation would block either |
no test coverage detected