(count int, keys any, valuePtr sys.Pointer, opts *BatchOptions)
| 1410 | } |
| 1411 | |
| 1412 | func (m *Map) batchUpdate(count int, keys any, valuePtr sys.Pointer, opts *BatchOptions) (int, error) { |
| 1413 | keyPtr, err := marshalMapSyscallInput(keys, count*int(m.keySize)) |
| 1414 | if err != nil { |
| 1415 | return 0, err |
| 1416 | } |
| 1417 | |
| 1418 | attr := sys.MapUpdateBatchAttr{ |
| 1419 | MapFd: m.fd.Uint(), |
| 1420 | Keys: keyPtr, |
| 1421 | Values: valuePtr, |
| 1422 | Count: uint32(count), |
| 1423 | } |
| 1424 | if opts != nil { |
| 1425 | attr.ElemFlags = opts.ElemFlags |
| 1426 | attr.Flags = opts.Flags |
| 1427 | } |
| 1428 | |
| 1429 | err = sys.MapUpdateBatch(&attr) |
| 1430 | if err != nil { |
| 1431 | if haveFeatErr := haveBatchAPI(); haveFeatErr != nil { |
| 1432 | return 0, haveFeatErr |
| 1433 | } |
| 1434 | return int(attr.Count), fmt.Errorf("batch update: %w", wrapMapError(err)) |
| 1435 | } |
| 1436 | |
| 1437 | return int(attr.Count), nil |
| 1438 | } |
| 1439 | |
| 1440 | func (m *Map) batchUpdatePerCPU(keys, values any, opts *BatchOptions) (int, error) { |
| 1441 | count, err := sliceLen(keys) |
no test coverage detected